Fixes #81109 - Typo in pointer::wrapping_sub

Signed-off-by: soniasingla <soniasingla.1812@gmail.com>
This commit is contained in:
soniasingla 2021-01-18 20:31:47 +05:30
parent 86e0ff47a0
commit 47c2476c68
2 changed files with 2 additions and 2 deletions

View File

@ -633,7 +633,7 @@ pub const fn wrapping_add(self, count: usize) -> Self
}
/// Calculates the offset from a pointer using wrapping arithmetic.
/// (convenience for `.wrapping_offset((count as isize).wrapping_sub())`)
/// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
///
/// `count` is in units of T; e.g., a `count` of 3 represents a pointer
/// offset of `3 * size_of::<T>()` bytes.

View File

@ -740,7 +740,7 @@ pub const fn wrapping_add(self, count: usize) -> Self
}
/// Calculates the offset from a pointer using wrapping arithmetic.
/// (convenience for `.wrapping_offset((count as isize).wrapping_sub())`)
/// (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
///
/// `count` is in units of T; e.g., a `count` of 3 represents a pointer
/// offset of `3 * size_of::<T>()` bytes.