We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
panic!()
assert!()
1 parent 98f61a3 commit 04aade8Copy full SHA for 04aade8
src/libcore/char/methods.rs
@@ -121,9 +121,7 @@ impl char {
121
#[stable(feature = "rust1", since = "1.0.0")]
122
#[inline]
123
pub fn to_digit(self, radix: u32) -> Option<u32> {
124
- if radix > 36 {
125
- panic!("to_digit: radix is too high (maximum 36)");
126
- }
+ assert!(radix <= 36, "to_digit: radix is too high (maximum 36)");
127
let val = match self {
128
'0' ..= '9' => self as u32 - '0' as u32,
129
'a' ..= 'z' => self as u32 - 'a' as u32 + 10,
0 commit comments