Skip to content

Commit 940a3cb

Browse files
committed
wip
1 parent 96c3b56 commit 940a3cb

File tree

7 files changed

+868
-257
lines changed

7 files changed

+868
-257
lines changed

src/deprecated.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ where
2121
#[doc(hidden)]
2222
#[inline]
2323
pub fn new_slice(bytes: B) -> Option<Ref<B, [T]>> {
24-
Self::new(bytes)
24+
Self::new(bytes).ok()
2525
}
2626
}
2727

@@ -34,7 +34,7 @@ where
3434
#[doc(hidden)]
3535
#[inline(always)]
3636
pub fn new_slice_unaligned(bytes: B) -> Option<Ref<B, [T]>> {
37-
Ref::new_unaligned(bytes)
37+
Ref::new_unaligned(bytes).ok()
3838
}
3939
}
4040

@@ -74,15 +74,15 @@ where
7474
#[doc(hidden)]
7575
#[inline]
7676
pub fn new_slice_from_prefix(bytes: B, count: usize) -> Option<(Ref<B, [T]>, B)> {
77-
Ref::with_trailing_elements_from_prefix(bytes, count)
77+
Ref::with_trailing_elements_from_prefix(bytes, count).ok()
7878
}
7979

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

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

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

0 commit comments

Comments
 (0)