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.
1 parent 845c14d commit 17e238dCopy full SHA for 17e238d
library/core/src/char/methods.rs
@@ -337,7 +337,7 @@ impl char {
337
// the `radix` is constant and 10 or smaller
338
let val = if likely(radix <= 10) {
339
// If not a digit, a number greater than radix will be created.
340
- self as u32 ^ ASCII_DIGIT_MASK
+ (self as u32).wrapping_sub('0' as u32)
341
} else {
342
match self {
343
'0'..='9' => self as u32 - '0' as u32,
0 commit comments