-
Notifications
You must be signed in to change notification settings - Fork 176
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
Consistently use bytes
not byte_slice
#5816
Consistently use bytes
not byte_slice
#5816
Conversation
c161875
to
afc957d
Compare
Reviewer note: can be reviewed individually. Do take a look at non-zerovec code affected by each commit in case something incorrect snuck through. |
e8a2cf4
to
ea2c68a
Compare
9495904
to
8a22eff
Compare
@@ -367,7 +367,7 @@ impl CaseMapDataULE { | |||
/// 6. The equality invariant is satisfied | |||
unsafe impl ULE for CaseMapDataULE { | |||
fn validate_byte_slice(bytes: &[u8]) -> Result<(), UleError> { | |||
let sixteens = RawBytesULE::<2>::parse_byte_slice(bytes)?; | |||
let sixteens = RawBytesULE::<2>::parse_bytes(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.
Thought: could be try_from_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.
I like this being parse()
but it's worth discussing. I'd want to do that separately IMO.
@@ -97,7 +97,7 @@ impl<'a, V: VarULE + ?Sized> VarZeroCow<'a, V> { | |||
} | |||
|
|||
/// Construct from an owned slice. Errors if the slice doesn't represent a valid `V` | |||
pub fn parse_owned_byte_slice(bytes: Box<[u8]>) -> Result<Self, UleError> { | |||
pub fn parse_owned_bytes(bytes: Box<[u8]>) -> Result<Self, UleError> { |
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.
Suggestion (optional): try_from_boxed_bytes
or parse_boxed_bytes
. I think "boxed bytes" is language used elsewhere
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.
I think for a Cow type "owned" is probably better.
1e698de
to
790b235
Compare
Fixes #5815