diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-06-13 22:55:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 22:55:48 +0200 |
| commit | 5de59519fb822b7e2f0e5eb3eeb3fc53875d4380 (patch) | |
| tree | bfbe32116b49e95ea2102c80eed9f5ecb21de6c5 | |
| parent | 141d458076a021729dd0884fd9d688d84b9de32f (diff) | |
| parent | 523408e6613dfb2eb5926350cd377f2198c3d9b4 (diff) | |
| download | rust-5de59519fb822b7e2f0e5eb3eeb3fc53875d4380.tar.gz rust-5de59519fb822b7e2f0e5eb3eeb3fc53875d4380.zip | |
Rollup merge of #126390 - Kriskras99:master, r=Nilstrieb
Fix wording in {checked_}next_power_of_two
Small documentation update
| -rw-r--r-- | library/core/src/num/nonzero.rs | 2 | ||||
| -rw-r--r-- | library/core/src/num/uint_macros.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 863f0d61df3..5956a08593a 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -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. diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 1491c27372b..cdbd695008e 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -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 /// @@ -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`. /// |
