diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-04-03 22:55:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-03 22:55:02 +0200 |
| commit | 9b22fdc121abfd860e2b7c753aa254f2bf29a1a8 (patch) | |
| tree | 31dbf4ff88f7c4d9a709ee1643761f9294c1ee88 /src/liballoc | |
| parent | f6fe99c798cb65280a9a56f442b371adcb7b8aa2 (diff) | |
| parent | c8312659403397c9fe4fcb2fd006268a7031d7a8 (diff) | |
| download | rust-9b22fdc121abfd860e2b7c753aa254f2bf29a1a8.tar.gz rust-9b22fdc121abfd860e2b7c753aa254f2bf29a1a8.zip | |
Rollup merge of #69860 - faern:use-assoc-int-consts, r=dtolnay
Use associated numeric consts in documentation Now when the associated constants on int/float types are stabilized and the recommended way of accessing said constants (#68952). We can start using it in this repository, and recommend it via documentation example code. This PR is the reincarnation of #67913 minus the actual adding + stabilization of said constants. (EDIT: Now it's only changing the documentation. So users will see the new consts, but we don't yet update the internal code) Because of how fast bit rot happens to PRs that touch this many files, it does not try to replace 100% of the old usage of the constants in the entire repo, but a good chunk of them.
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/slice.rs | 2 | ||||
| -rw-r--r-- | src/liballoc/str.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index d8fc1faca3a..2ce5bc8ed2f 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -432,7 +432,7 @@ impl<T> [T] { /// /// ```should_panic /// // this will panic at runtime - /// b"0123456789abcdef".repeat(usize::max_value()); + /// b"0123456789abcdef".repeat(usize::MAX); /// ``` #[stable(feature = "repeat_generic_slice", since = "1.40.0")] pub fn repeat(&self, n: usize) -> Vec<T> diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 843a2f1f8e9..70860c09a2c 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -499,7 +499,7 @@ impl str { /// /// ```should_panic /// // this will panic at runtime - /// "0123456789abcdef".repeat(usize::max_value()); + /// "0123456789abcdef".repeat(usize::MAX); /// ``` #[stable(feature = "repeat_str", since = "1.16.0")] pub fn repeat(&self, n: usize) -> String { |
