-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: add copy_*e_to_slice
family
#423
Conversation
ab04803
to
60147b0
Compare
55c7ef2
to
4bd34e1
Compare
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.
LGTM. We should start running tests in a big-endian environment in CI
src/support/borsh.rs
Outdated
let bytes = self.as_le_bytes(); | ||
writer.write_all(&bytes[..Self::BYTES]) | ||
#[cfg(target_endian = "little")] | ||
return writer.write_all(&self.as_le_slice()[..Self::BYTES]); |
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.
return writer.write_all(&self.as_le_slice()[..Self::BYTES]); | |
return writer.write_all(self.as_le_slice()); |
b6c3d74
to
45d2694
Compare
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.
LGTM
#[cfg(target_endian = "little")] | ||
return writer.write_all(self.as_le_slice()); | ||
|
||
// TODO: Replace the unsafety with `generic_const_exprs` when |
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.
do we have an issue for this filed?
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.
The actions bot will auto file it when the PR is merged
closing in favor of #424 |
Motivation
Add convenient methods for writing Uints to pre-allocated buffers
Solution
PR Checklist