We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9b3ff7 commit bf02d1eCopy full SHA for bf02d1e
library/core/src/char/methods.rs
@@ -343,10 +343,10 @@ impl char {
343
without modifying the original"]
344
#[inline]
345
pub const fn to_digit(self, radix: u32) -> Option<u32> {
346
- assert!(radix <= 36, "to_digit: radix is too high (maximum 36)");
347
// If not a digit, a number greater than radix will be created.
348
let mut digit = (self as u32).wrapping_sub('0' as u32);
349
if radix > 10 {
+ assert!(radix <= 36, "to_digit: radix is too high (maximum 36)");
350
if digit < 10 {
351
return Some(digit);
352
}
0 commit comments