Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] write APIs should take buffer: &mut [MaybeUninit<u8>] #92

Open
reinerp opened this issue Feb 22, 2023 · 0 comments
Open

[FEATURE] write APIs should take buffer: &mut [MaybeUninit<u8>] #92

reinerp opened this issue Feb 22, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request high priority High priority

Comments

@reinerp
Copy link

reinerp commented Feb 22, 2023

Problem

In the ToLexical APIs, they take the destination buffer as type &mut [u8]. According to Rust's soundness rules, this requires the buffer to be initialized before calling to_lexical or to_lexical_unchecked, even though both of those functions only write to the buffer. I'd like to use ToLexical on uninitialized buffers (such as Vec::spare_capacity_mut).

Solution

Can we have a variant of the ToLexical APIs to take the destination buffer as type &mut [MaybeUninit<u8>]?

@reinerp reinerp added the enhancement New feature or request label Feb 22, 2023
@Alexhuszagh Alexhuszagh added the high priority High priority label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority High priority
Projects
None yet
Development

No branches or pull requests

2 participants