Skip to content

Commit

Permalink
Rollup merge of rust-lang#126390 - Kriskras99:master, r=Nilstrieb
Browse files Browse the repository at this point in the history
Fix wording in {checked_}next_power_of_two

Small documentation update
  • Loading branch information
workingjubilee committed Jun 13, 2024
2 parents b96c7ef + 523408e commit 3475261
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
unsafe { Self::new_unchecked(self.get().unchecked_add(other)) }
}

/// Returns the smallest power of two greater than or equal to n.
/// Returns the smallest power of two greater than or equal to `self`.
/// Checks for overflow and returns [`None`]
/// if the next power of two is greater than the type’s maximum value.
/// As a consequence, the result cannot wrap to zero.
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,7 @@ macro_rules! uint_impl {
///
/// When return value overflows (i.e., `self > (1 << (N-1))` for type
/// `uN`), it panics in debug mode and the return value is wrapped to 0 in
/// release mode (the only situation in which method can return 0).
/// release mode (the only situation in which this method can return 0).
///
/// # Examples
///
Expand All @@ -2851,7 +2851,7 @@ macro_rules! uint_impl {
self.one_less_than_next_power_of_two() + 1
}

/// Returns the smallest power of two greater than or equal to `n`. If
/// Returns the smallest power of two greater than or equal to `self`. If
/// the next power of two is greater than the type's maximum value,
/// `None` is returned, otherwise the power of two is wrapped in `Some`.
///
Expand Down

0 comments on commit 3475261

Please sign in to comment.