Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da3cad9

Browse files
authored
Merge pull request #10 from yue2388253/master
'...' range patterns are deprecated, fix it
2 parents c6d2e23 + 18041a2 commit da3cad9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

‎src/n0008_string_to_integer_atoi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Solution {
7474
if !num_matched {
7575
match ch {
7676
' ' => {},
77-
'0'...'9' => {
77+
'0'..='9' => {
7878
num_matched = true;
7979
result = result * 10 + ch.to_digit(10).unwrap() as i64;
8080
},
@@ -84,7 +84,7 @@ impl Solution {
8484
}
8585
} else {
8686
match ch {
87-
'0'...'9' => {
87+
'0'..='9' => {
8888
result = result * 10 + ch.to_digit(10).unwrap() as i64;
8989
if result > i32_max { break }
9090
},

‎src/n0224_basic_calculator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Solution {
5252
let mut in_num = false;
5353
for ch in s.chars() {
5454
match ch {
55-
'0'...'9' => {
55+
'0'..='9' => {
5656
in_num = true;
5757
num = 10 * num + (ch as u8 - '0' as u8) as i64;
5858
}

‎src/n0227_basic_calculator_ii.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Solution {
4747
let mut multiple = true;
4848
for ch in s.chars() {
4949
match ch {
50-
'0'...'9' => { curr = 10 * curr + (ch as u8 - '0' as u8) as i64; },
50+
'0'..='9' => { curr = 10 * curr + (ch as u8 - '0' as u8) as i64; },
5151
'+' | '-' => {
5252
if has_prev {
5353
if multiple {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /