From ec50be3bbe61ec096e3a21973415a5789ff2471a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 14 Nov 2024 23:21:41 +0000 Subject: [PATCH] docs --- src/lib.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b343c7d..f13d929 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -73,9 +73,8 @@ use std::ptr::NonNull; /// **Pointer to manually-memory-managed `T`** /// -/// Ensuring that `Ptr`s are freed at the right time is up to the caller. -/// But aliasing, and other Rust unsafe footguns, -/// is (largely) handled by the library. +/// `Ptr` usually refers to an item on the heap, like `Box`. +/// It can be made from `T` with [`Ptr::new_heap()`]. /// /// To access the contained data, /// [`Ptr::borrow()`] @@ -90,14 +89,14 @@ use std::ptr::NonNull; /// [`.borrow_mut()`](Ptr::borrow_mut()) with /// [`MutToken::new_unchecked()`]. /// -/// # -/// -/// The API is sound in the usual Rust sense: -/// however, it -/// /// This type is `Copy`. Copying it (or, indeed, cloning it) /// does not copy the underlying data. /// Nor is there any reference counting or garbage collection. +/// +/// Ensuring that `Ptr`s are freed at the right time is up to the caller, +/// But aliasing, and other Rust unsafe footguns, +/// is (largely) handled by the library. +/// See the [module-level documentation](crate). pub struct Ptr { /// # SAFETY /// -- 2.30.2