Fix OwningPtr docs (#5391)

# Objective

- Fix some small errors in the documentation of the `OwningPtr` struct.

## Solution

- Change comments with 4 slashes `////` to doc comments with 3 slashes `///`.
- Fix typos.
This commit is contained in:
KDecay 2022-07-20 13:16:28 +00:00
parent c2b332f98a
commit 222f2dd32c

View File

@ -166,7 +166,7 @@ impl<'a> OwningPtr<'a> {
f(Self(ptr, PhantomData)) f(Self(ptr, PhantomData))
} }
//// Consumes the [`OwningPtr`] to obtain ownership of the underlying data of type `T`. /// Consumes the [`OwningPtr`] to obtain ownership of the underlying data of type `T`.
/// ///
/// # Safety /// # Safety
/// Must point to a valid `T`. /// Must point to a valid `T`.
@ -175,7 +175,7 @@ impl<'a> OwningPtr<'a> {
self.as_ptr().cast::<T>().read() self.as_ptr().cast::<T>().read()
} }
//// Consumes the [`OwningPtr`] to drop the underlying data of type `T`. /// Consumes the [`OwningPtr`] to drop the underlying data of type `T`.
/// ///
/// # Safety /// # Safety
/// Must point to a valid `T`. /// Must point to a valid `T`.
@ -195,7 +195,7 @@ impl<'a> OwningPtr<'a> {
} }
} }
/// Conceptually equilavent to `&'a [T]` but with length information cut out for performance reasons /// Conceptually equivalent to `&'a [T]` but with length information cut out for performance reasons
pub struct ThinSlicePtr<'a, T> { pub struct ThinSlicePtr<'a, T> {
ptr: NonNull<T>, ptr: NonNull<T>,
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
@ -208,7 +208,7 @@ impl<'a, T> ThinSlicePtr<'a, T> {
/// Indexes the slice without doing bounds checks /// Indexes the slice without doing bounds checks
/// ///
/// # Safety /// # Safety
/// `index` must be inbounds. /// `index` must be in-bounds.
pub unsafe fn get(self, index: usize) -> &'a T { pub unsafe fn get(self, index: usize) -> &'a T {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
debug_assert!(index < self.len); debug_assert!(index < self.len);