Rollup merge of #96639 - adpaco-aws:fix-offset-from-typo, r=scottmcm

Fix typo in `offset_from` documentation

Small fix for what I think is a typo in the `offset_from` documentation.

Someone reading this may understand that the distance in bytes is obtained by dividing the distance by `mem::size_of::<T>()`, but here we just want to define "units of T" in terms of bytes (i.e., units of T == bytes / `mem::size_of::<T>()`).
This commit is contained in:
Michael Goulet
2022-05-05 19:34:23 -07:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -518,7 +518,7 @@ pub const fn wrapping_offset(self, count: isize) -> *const T
}
/// Calculates the distance between two pointers. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
/// units of T: the distance in bytes divided by `mem::size_of::<T>()`.
///
/// This function is the inverse of [`offset`].
///
+1 -1
View File
@@ -696,7 +696,7 @@ pub const fn guaranteed_eq(self, other: *mut T) -> bool
}
/// Calculates the distance between two pointers. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
/// units of T: the distance in bytes divided by `mem::size_of::<T>()`.
///
/// This function is the inverse of [`offset`].
///