Skip to content

Commit

Permalink
Refer to add method instead of offset
Browse files Browse the repository at this point in the history
The `align_offset` method returns an `usize`, so using `add` makes more sense than using `offset`, which takes an `isize`.
  • Loading branch information
phil-opp committed Jul 17, 2019
1 parent fed12fa commit c9c73f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ impl<T: ?Sized> *const T {
/// `usize::max_value()`.
///
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
/// used with the `offset` method.
/// used with the `add` method.
///
/// There are no guarantees whatsover that offsetting the pointer will not overflow or go
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
Expand Down Expand Up @@ -2335,7 +2335,7 @@ impl<T: ?Sized> *mut T {
/// `usize::max_value()`.
///
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
/// used with the `offset` method.
/// used with the `add` method.
///
/// There are no guarantees whatsover that offsetting the pointer will not overflow or go
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
Expand Down

0 comments on commit c9c73f5

Please sign in to comment.