From a65ceff9a3872f1d52dd0ff2984b971ccc3897bf Mon Sep 17 00:00:00 2001 From: marc0246 <40955683+marc0246@users.noreply.github.com> Date: Sat, 15 Feb 2025 17:34:32 +0100 Subject: [PATCH] Fix comments --- src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d442d20..3cf031d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -171,10 +171,9 @@ impl Allocation { self.inner.ptr().cast() } - /// Returns the size that was used to [allocate] `self` aligned up to the [page size]. + /// Returns the size that was used to [allocate] `self`. /// /// [allocate]: Self::new - /// [page size]: self#pages #[inline(always)] #[must_use] pub const fn size(&self) -> usize { @@ -319,7 +318,7 @@ fn is_aligned(val: usize, alignment: usize) -> bool { /// The type returned by the various [`Allocation`] methods. pub type Result = ::core::result::Result; -/// Represents an OS error that can be returned by the by the various [`Allocation`] methods. +/// Represents an OS error that can be returned by the various [`Allocation`] methods. #[derive(Debug)] pub struct Error { code: i32, @@ -910,14 +909,14 @@ mod windows { type HMODULE = *mut c_void; } -// TODO: Replace this with `<*const u8>::addr` once it's stable. +// TODO: Replace this with `<*const u8>::addr` once we release a breaking version. #[allow(clippy::transmutes_expressible_as_ptr_casts)] fn addr(ptr: *const u8) -> usize { // SAFETY: `*const u8` and `usize` have the same layout. unsafe { mem::transmute::<*const u8, usize>(ptr) } } -// TODO: Replace this with `ptr::without_provenance_mut` once it's stable. +// TODO: Replace this with `ptr::without_provenance_mut` once we release a breaking version. #[allow(clippy::useless_transmute)] const fn without_provenance_mut(addr: usize) -> *mut u8 { // SAFETY: `usize` and `*mut u8` have the same layout.