Use .contains instead of manual reimplementation.
It's also significantly easier to read.
This commit is contained in:
parent
e91405b9d5
commit
499758a285
1 changed files with 1 additions and 1 deletions
|
@ -847,7 +847,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
|
||||||
use self::ParseIntError as PIE;
|
use self::ParseIntError as PIE;
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
radix >= 2 && radix <= 36,
|
(2..=36).contains(&radix),
|
||||||
"from_str_radix_int: must lie in the range `[2, 36]` - found {}",
|
"from_str_radix_int: must lie in the range `[2, 36]` - found {}",
|
||||||
radix
|
radix
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue