File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ impl<T: ?Sized> NonNull<T> {
143
143
}
144
144
145
145
impl < T > NonNull < [ T ] > {
146
- /// Create a non-null raw slice from a thin pointer and a length.
146
+ /// Creates a non-null raw slice from a thin pointer and a length.
147
147
///
148
148
/// The `len` argument is the number of **elements**, not the number of bytes.
149
149
///
@@ -171,12 +171,12 @@ impl<T> NonNull<[T]> {
171
171
#[ unstable( feature = "nonnull_slice_from_raw_parts" , issue = "71941" ) ]
172
172
#[ rustc_const_unstable( feature = "const_nonnull_slice_from_raw_parts" , issue = "71941" ) ]
173
173
#[ inline]
174
- pub const fn slice_from_raw_parts ( data : NonNull < T > , size : usize ) -> Self {
174
+ pub const fn slice_from_raw_parts ( data : NonNull < T > , len : usize ) -> Self {
175
175
// SAFETY: `data` is a `NonNull` pointer which is necessarily non-null
176
- unsafe { Self :: new_unchecked ( super :: slice_from_raw_parts_mut ( data. as_ptr ( ) , size ) ) }
176
+ unsafe { Self :: new_unchecked ( super :: slice_from_raw_parts_mut ( data. as_ptr ( ) , len ) ) }
177
177
}
178
178
179
- /// Return the length and a non-null raw slice.
179
+ /// Returns the length of a non-null raw slice.
180
180
///
181
181
/// The returned value is the number of **elements**, not the number of bytes.
182
182
///
You can’t perform that action at this time.
0 commit comments