Skip to content

Commit d4f781e

Browse files
authored
Rollup merge of rust-lang#87723 - frogtd:patch-3, r=JohnTitor
Use .contains instead of manual reimplementation. It's also significantly easier to read.
2 parents 3610d6c + 34e0b70 commit d4f781e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
847847
use self::ParseIntError as PIE;
848848

849849
assert!(
850-
radix >= 2 && radix <= 36,
850+
(2..=36).contains(&radix),
851851
"from_str_radix_int: must lie in the range `[2, 36]` - found {}",
852852
radix
853853
);

0 commit comments

Comments
 (0)