-
Notifications
You must be signed in to change notification settings - Fork 105
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 TryFromBytes::try_{ref,mut}_from_{bytes,prefix,suffix}_with_elems #1747
Conversation
5cdb8d8
to
b0d1b2f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1747 +/- ##
==========================================
- Coverage 88.01% 87.13% -0.89%
==========================================
Files 16 16
Lines 5833 5892 +59
==========================================
Hits 5134 5134
- Misses 699 758 +59 ☔ View full report in Codecov by Sentry. |
b0d1b2f
to
cb103be
Compare
Hit merge when you're satisfied, @joshlf. |
src/lib.rs
Outdated
count: usize, | ||
) -> Result<&mut Self, TryCastError<&mut [u8], Self>> | ||
where | ||
Self: KnownLayout<PointerMetadata = usize> + Immutable, |
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.
Remove the Immutable bound?
src/lib.rs
Outdated
count: usize, | ||
) -> Result<(&mut Self, &mut [u8]), TryCastError<&mut [u8], Self>> | ||
where | ||
Self: KnownLayout<PointerMetadata = usize> + Immutable, |
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.
Remove the Immutable bound?
src/lib.rs
Outdated
count: usize, | ||
) -> Result<(&mut [u8], &mut Self), TryCastError<&mut [u8], Self>> | ||
where | ||
Self: KnownLayout<PointerMetadata = usize> + Immutable, |
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.
Remove the Immutable bound?
Makes progress on #5
src/lib.rs
Outdated
/// use zerocopy::*; | ||
/// # use zerocopy_derive::*; | ||
/// | ||
/// #[derive(TryFromBytes, Immutable, KnownLayout)] |
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.
Don't derive Immutable here?
src/lib.rs
Outdated
/// # use zerocopy_derive::*; | ||
/// | ||
/// // The only valid value of this type is the byte `0xC0` | ||
/// #[derive(TryFromBytes, KnownLayout, Immutable)] |
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.
Don't derive Immutable here?
src/lib.rs
Outdated
/// # use zerocopy_derive::*; | ||
/// | ||
/// // The only valid value of this type is the byte `0xC0` | ||
/// #[derive(TryFromBytes, KnownLayout, Immutable)] |
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.
Don't derive Immutable here?
src/lib.rs
Outdated
/// use zerocopy::*; | ||
/// # use zerocopy_derive::*; | ||
/// | ||
/// #[derive(TryFromBytes, Immutable, KnownLayout)] |
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.
Don't derive Immutable here?
src/lib.rs
Outdated
/// # use zerocopy_derive::*; | ||
/// | ||
/// // The only valid value of this type is the byte `0xC0` | ||
/// #[derive(TryFromBytes, KnownLayout, Immutable)] |
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.
Don't derive Immutable here?
src/lib.rs
Outdated
/// use zerocopy::*; | ||
/// # use zerocopy_derive::*; | ||
/// | ||
/// #[derive(TryFromBytes, Immutable, KnownLayout)] |
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.
Don't derive Immutable here?
cb103be
to
95a8ca7
Compare
Awesome, queued! |
Makes progress on #5