Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix OwningPtr docs #5391

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/bevy_ptr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl<'a> OwningPtr<'a> {
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
/// Must point to a valid `T`.
Expand All @@ -175,7 +175,7 @@ impl<'a> OwningPtr<'a> {
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
/// Must point to a valid `T`.
Expand All @@ -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> {
ptr: NonNull<T>,
#[cfg(debug_assertions)]
Expand All @@ -208,7 +208,7 @@ impl<'a, T> ThinSlicePtr<'a, T> {
/// Indexes the slice without doing bounds checks
///
/// # Safety
/// `index` must be inbounds.
/// `index` must be in-bounds.
pub unsafe fn get(self, index: usize) -> &'a T {
#[cfg(debug_assertions)]
debug_assert!(index < self.len);
Expand Down