Skip to content

Commit

Permalink
Remove more unnecessary Immutable bounds from FromBytes
Browse files Browse the repository at this point in the history
Makes progress on #251.
  • Loading branch information
jswrenn committed May 10, 2024
1 parent f8057e9 commit bac7f08
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2870,7 +2870,7 @@ pub unsafe trait FromBytes: FromZeros {
#[inline]
fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>
where
Self: Sized + IntoBytes + Immutable,
Self: Sized + IntoBytes,
{
<[Self]>::mut_from(bytes).ok()
}
Expand Down Expand Up @@ -2947,7 +2947,7 @@ pub unsafe trait FromBytes: FromZeros {
count: usize,
) -> Result<(&mut Self, &mut [u8]), CastError<&mut [u8], Self>>
where
Self: IntoBytes + KnownLayout<PointerMetadata = usize> + Immutable,
Self: IntoBytes + KnownLayout<PointerMetadata = usize>,
{
mut_from_prefix_suffix(bytes, Some(count), CastType::Prefix)
}
Expand All @@ -2961,7 +2961,7 @@ pub unsafe trait FromBytes: FromZeros {
#[inline]
fn mut_slice_from_prefix(bytes: &mut [u8], count: usize) -> Option<(&mut [Self], &mut [u8])>
where
Self: Sized + IntoBytes + Immutable,
Self: Sized + IntoBytes,
{
<[Self]>::mut_from_prefix_with_trailing_elements(bytes, count).ok()
}
Expand Down Expand Up @@ -3038,7 +3038,7 @@ pub unsafe trait FromBytes: FromZeros {
count: usize,
) -> Result<(&mut [u8], &mut Self), CastError<&mut [u8], Self>>
where
Self: IntoBytes + KnownLayout<PointerMetadata = usize> + Immutable,
Self: IntoBytes + KnownLayout<PointerMetadata = usize>,
{
mut_from_prefix_suffix(bytes, Some(count), CastType::Suffix).map(swap)
}
Expand All @@ -3051,7 +3051,7 @@ pub unsafe trait FromBytes: FromZeros {
#[inline]
fn mut_slice_from_suffix(bytes: &mut [u8], count: usize) -> Option<(&mut [u8], &mut [Self])>
where
Self: Sized + IntoBytes + Immutable,
Self: Sized + IntoBytes,
{
<[Self]>::mut_from_suffix_with_trailing_elements(bytes, count).ok()
}
Expand Down

0 comments on commit bac7f08

Please sign in to comment.