diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-08-04 08:05:55 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-04 08:05:55 +0900 |
| commit | af8c99a2353e5e2d09d30360063d0575d385cec6 (patch) | |
| tree | e24d3545f8e697a1ee5a827d68bc781fb2432b70 /library/core/src | |
| parent | 917c047c33a0b44b5406c8aab9e47d693106cbba (diff) | |
| parent | 499758a285e57a9a2dd3d02a887d03772ebfc85e (diff) | |
| download | rust-af8c99a2353e5e2d09d30360063d0575d385cec6.tar.gz rust-af8c99a2353e5e2d09d30360063d0575d385cec6.zip | |
Rollup merge of #87723 - frogtd:patch-3, r=JohnTitor
Use .contains instead of manual reimplementation. It's also significantly easier to read.
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/num/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index 6c43d6d6212..9788404dd05 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -847,7 +847,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par use self::ParseIntError as PIE; assert!( - radix >= 2 && radix <= 36, + (2..=36).contains(&radix), "from_str_radix_int: must lie in the range `[2, 36]` - found {}", radix ); |
