Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jswrenn committed Apr 27, 2024
1 parent 96c3b56 commit 2d2c41f
Show file tree
Hide file tree
Showing 7 changed files with 880 additions and 269 deletions.
12 changes: 6 additions & 6 deletions src/deprecated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ where
#[doc(hidden)]
#[inline]
pub fn new_slice(bytes: B) -> Option<Ref<B, [T]>> {
Self::new(bytes)
Self::new(bytes).ok()
}
}

Expand All @@ -34,7 +34,7 @@ where
#[doc(hidden)]
#[inline(always)]
pub fn new_slice_unaligned(bytes: B) -> Option<Ref<B, [T]>> {
Ref::new_unaligned(bytes)
Ref::new_unaligned(bytes).ok()
}
}

Expand Down Expand Up @@ -74,15 +74,15 @@ where
#[doc(hidden)]
#[inline]
pub fn new_slice_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> {
Ref::with_trailing_elements_from_prefix(bytes, count)
Ref::with_trailing_elements_from_prefix(bytes, count).ok()
}

#[deprecated(since = "0.8.0", note = "replaced by `Ref::with_trailing_elements_from_suffix`")]
#[must_use = "has no side effects"]
#[doc(hidden)]
#[inline]
pub fn new_slice_from_suffix(bytes: B, count: usize) -> Option<(B, Ref<B, [T]>)> {
Ref::with_trailing_elements_from_suffix(bytes, count)
Ref::with_trailing_elements_from_suffix(bytes, count).ok()
}
}

Expand All @@ -99,7 +99,7 @@ where
#[must_use = "has no side effects"]
#[inline(always)]
pub fn new_slice_unaligned_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> {
Ref::with_trailing_elements_unaligned_from_prefix(bytes, count)
Ref::with_trailing_elements_unaligned_from_prefix(bytes, count).ok()
}

#[deprecated(
Expand All @@ -110,6 +110,6 @@ where
#[must_use = "has no side effects"]
#[inline(always)]
pub fn new_slice_unaligned_from_suffix(bytes: B, count: usize) -> Option<(B, Ref<B, [T]>)> {
Ref::with_trailing_elements_unaligned_from_suffix(bytes, count)
Ref::with_trailing_elements_unaligned_from_suffix(bytes, count).ok()
}
}
Loading

0 comments on commit 2d2c41f

Please sign in to comment.