1
Fork 0

Rollup merge of #87723 - frogtd:patch-3, r=JohnTitor

Use .contains instead of manual reimplementation.

It's also significantly easier to read.
This commit is contained in:
Yuki Okushi 2021-08-04 08:05:55 +09:00 committed by GitHub
commit af8c99a235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
);