-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add more methods to EncodeAsVarULE #1199
Conversation
/// Write the corresponding [`VarULE`] type to the `dst` buffer. `dst` should | ||
/// be the size of [`Self::encoded_var_ule_length()`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the "should" here a safety constraint?
Do the bytes need to be initialized? If not, should we require that the impl writes across every byte?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it's written such that implementations will panic if it's not followed, hence the should not must.
&mut [u8]
in rust is invalid if not initialized: if we wish to allow uninitialized buffers, we must use *mut [u8]
instead.
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
Co-authored-by: Shane F. Carr <shane@unicode.org>
Part of #1082
fixes #1179
Names bikesheddable, I wanted them to all mention
var_ule
at least.