From 861dfaa855ba61bdc8eaccc0652e6fdb8eadf4c3 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 7 May 2020 07:47:24 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: kennytm --- src/libcore/ptr/non_null.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs index ed99452397f9..870364a61dd4 100644 --- a/src/libcore/ptr/non_null.rs +++ b/src/libcore/ptr/non_null.rs @@ -143,7 +143,7 @@ impl NonNull { } impl NonNull<[T]> { - /// Create a non-null raw slice from a thin pointer and a length. + /// Creates a non-null raw slice from a thin pointer and a length. /// /// The `len` argument is the number of **elements**, not the number of bytes. /// @@ -171,12 +171,12 @@ impl NonNull<[T]> { #[unstable(feature = "nonnull_slice_from_raw_parts", issue = "71941")] #[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")] #[inline] - pub const fn slice_from_raw_parts(data: NonNull, size: usize) -> Self { + pub const fn slice_from_raw_parts(data: NonNull, len: usize) -> Self { // SAFETY: `data` is a `NonNull` pointer which is necessarily non-null - unsafe { Self::new_unchecked(super::slice_from_raw_parts_mut(data.as_ptr(), size)) } + unsafe { Self::new_unchecked(super::slice_from_raw_parts_mut(data.as_ptr(), len)) } } - /// Return the length and a non-null raw slice. + /// Returns the length of a non-null raw slice. /// /// The returned value is the number of **elements**, not the number of bytes. ///