Skip to content

Commit 861dfaa

Browse files
SimonSapinkennytm
andcommitted
Apply suggestions from code review
Co-authored-by: kennytm <[email protected]>
1 parent 49d5f5a commit 861dfaa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/ptr/non_null.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<T: ?Sized> NonNull<T> {
143143
}
144144

145145
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.
147147
///
148148
/// The `len` argument is the number of **elements**, not the number of bytes.
149149
///
@@ -171,12 +171,12 @@ impl<T> NonNull<[T]> {
171171
#[unstable(feature = "nonnull_slice_from_raw_parts", issue = "71941")]
172172
#[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")]
173173
#[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 {
175175
// 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)) }
177177
}
178178

179-
/// Return the length and a non-null raw slice.
179+
/// Returns the length of a non-null raw slice.
180180
///
181181
/// The returned value is the number of **elements**, not the number of bytes.
182182
///

0 commit comments

Comments
 (0)