21
21
#[ doc( hidden) ]
22
22
#[ inline]
23
23
pub fn new_slice ( bytes : B ) -> Option < Ref < B , [ T ] > > {
24
- Self :: new ( bytes)
24
+ Self :: new ( bytes) . ok ( )
25
25
}
26
26
}
27
27
34
34
#[ doc( hidden) ]
35
35
#[ inline( always) ]
36
36
pub fn new_slice_unaligned ( bytes : B ) -> Option < Ref < B , [ T ] > > {
37
- Ref :: new_unaligned ( bytes)
37
+ Ref :: new_unaligned ( bytes) . ok ( )
38
38
}
39
39
}
40
40
@@ -74,15 +74,15 @@ where
74
74
#[ doc( hidden) ]
75
75
#[ inline]
76
76
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 ( )
78
78
}
79
79
80
80
#[ deprecated( since = "0.8.0" , note = "replaced by `Ref::with_trailing_elements_from_suffix`" ) ]
81
81
#[ must_use = "has no side effects" ]
82
82
#[ doc( hidden) ]
83
83
#[ inline]
84
84
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 ( )
86
86
}
87
87
}
88
88
99
99
#[ must_use = "has no side effects" ]
100
100
#[ inline( always) ]
101
101
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 ( )
103
103
}
104
104
105
105
#[ deprecated(
@@ -110,6 +110,6 @@ where
110
110
#[ must_use = "has no side effects" ]
111
111
#[ inline( always) ]
112
112
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 ( )
114
114
}
115
115
}
0 commit comments