From 1c09edf7b08ad9c052585b73b9903b5c8d70bb04 Mon Sep 17 00:00:00 2001 From: Timothy Hoffman <4001421+tim-hoffman@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:18:57 -0500 Subject: [PATCH] fix #274 (#275) --- src/checked.rs | 14 +++++++------- src/internal.rs | 14 +++++++------- src/lib.rs | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/checked.rs b/src/checked.rs index 3299ce8..c3b131e 100644 --- a/src/checked.rs +++ b/src/checked.rs @@ -292,7 +292,7 @@ pub fn try_pod_read_unaligned( } } -/// Try to cast `T` into `U`. +/// Try to cast `A` into `B`. /// /// Note that for this particular type of cast, alignment isn't a factor. The /// input value is semantically copied into the function and then returned to a @@ -316,7 +316,7 @@ pub fn try_cast( } } -/// Try to convert a `&T` into `&U`. +/// Try to convert a `&A` into `&B`. /// /// ## Failure /// @@ -336,7 +336,7 @@ pub fn try_cast_ref( } } -/// Try to convert a `&mut T` into `&mut U`. +/// Try to convert a `&mut A` into `&mut B`. /// /// As [`try_cast_ref`], but `mut`. #[inline] @@ -445,7 +445,7 @@ pub fn pod_read_unaligned(bytes: &[u8]) -> T { } } -/// Cast `T` into `U` +/// Cast `A` into `B` /// /// ## Panics /// @@ -458,7 +458,7 @@ pub fn cast(a: A) -> B { } } -/// Cast `&mut T` into `&mut U`. +/// Cast `&mut A` into `&mut B`. /// /// ## Panics /// @@ -476,7 +476,7 @@ pub fn cast_mut< } } -/// Cast `&T` into `&U`. +/// Cast `&A` into `&B`. /// /// ## Panics /// @@ -502,7 +502,7 @@ pub fn cast_slice(a: &[A]) -> &[B] { } } -/// Cast `&mut [T]` into `&mut [U]`. +/// Cast `&mut [A]` into `&mut [B]`. /// /// ## Panics /// diff --git a/src/internal.rs b/src/internal.rs index 06935e6..cbca509 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -180,7 +180,7 @@ pub(crate) unsafe fn try_from_bytes_mut( } } -/// Cast `T` into `U` +/// Cast `A` into `B` /// /// ## Panics /// @@ -194,7 +194,7 @@ pub(crate) unsafe fn cast(a: A) -> B { } } -/// Cast `&mut T` into `&mut U`. +/// Cast `&mut A` into `&mut B`. /// /// ## Panics /// @@ -215,7 +215,7 @@ pub(crate) unsafe fn cast_mut(a: &mut A) -> &mut B { } } -/// Cast `&T` into `&U`. +/// Cast `&A` into `&B`. /// /// ## Panics /// @@ -249,7 +249,7 @@ pub(crate) unsafe fn cast_slice(a: &[A]) -> &[B] { } } -/// Cast `&mut [T]` into `&mut [U]`. +/// Cast `&mut [A]` into `&mut [B]`. /// /// ## Panics /// @@ -262,7 +262,7 @@ pub(crate) unsafe fn cast_slice_mut(a: &mut [A]) -> &mut [B] { } } -/// Try to cast `T` into `U`. +/// Try to cast `A` into `B`. /// /// Note that for this particular type of cast, alignment isn't a factor. The /// input value is semantically copied into the function and then returned to a @@ -283,7 +283,7 @@ pub(crate) unsafe fn try_cast( } } -/// Try to convert a `&T` into `&U`. +/// Try to convert a `&A` into `&B`. /// /// ## Failure /// @@ -306,7 +306,7 @@ pub(crate) unsafe fn try_cast_ref( } } -/// Try to convert a `&mut T` into `&mut U`. +/// Try to convert a `&mut A` into `&mut B`. /// /// As [`try_cast_ref`], but `mut`. #[inline] diff --git a/src/lib.rs b/src/lib.rs index ca7c1d6..a8cddfa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -326,7 +326,7 @@ pub fn try_from_bytes_mut( unsafe { internal::try_from_bytes_mut(s) } } -/// Cast `T` into `U` +/// Cast `A` into `B` /// /// ## Panics /// @@ -336,7 +336,7 @@ pub fn cast(a: A) -> B { unsafe { internal::cast(a) } } -/// Cast `&mut T` into `&mut U`. +/// Cast `&mut A` into `&mut B`. /// /// ## Panics /// @@ -348,7 +348,7 @@ pub fn cast_mut( unsafe { internal::cast_mut(a) } } -/// Cast `&T` into `&U`. +/// Cast `&A` into `&B`. /// /// ## Panics /// @@ -368,7 +368,7 @@ pub fn cast_slice(a: &[A]) -> &[B] { unsafe { internal::cast_slice(a) } } -/// Cast `&mut [T]` into `&mut [U]`. +/// Cast `&mut [A]` into `&mut [B]`. /// /// ## Panics /// @@ -404,7 +404,7 @@ pub fn pod_align_to_mut< unsafe { vals.align_to_mut::() } } -/// Try to cast `T` into `U`. +/// Try to cast `A` into `B`. /// /// Note that for this particular type of cast, alignment isn't a factor. The /// input value is semantically copied into the function and then returned to a @@ -421,7 +421,7 @@ pub fn try_cast( unsafe { internal::try_cast(a) } } -/// Try to convert a `&T` into `&U`. +/// Try to convert a `&A` into `&B`. /// /// ## Failure /// @@ -434,7 +434,7 @@ pub fn try_cast_ref( unsafe { internal::try_cast_ref(a) } } -/// Try to convert a `&mut T` into `&mut U`. +/// Try to convert a `&mut A` into `&mut B`. /// /// As [`try_cast_ref`], but `mut`. #[inline]