Skip to content

Commit 6ee533b

Browse files
tesujialexcrichton
authored andcommitted
use cargo fix to automatically fix range pattern
1 parent a7608b5 commit 6ee533b

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/legacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'a> fmt::Display for Demangle<'a> {
162162
if escape.starts_with('u') {
163163
let digits = &escape[1..];
164164
let all_lower_hex = digits.chars().all(|c| match c {
165-
'0'...'9' | 'a'...'f' => true,
165+
'0'..='9' | 'a'..='f' => true,
166166
_ => false,
167167
});
168168
let c = u32::from_str_radix(digits, 16)

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn demangle(mut s: &str) -> Demangle {
7070
if let Some(i) = s.find(llvm) {
7171
let candidate = &s[i + llvm.len()..];
7272
let all_hex = candidate.chars().all(|c| match c {
73-
'A'...'F' | '0'...'9' | '@' => true,
73+
'A'..='F' | '0'..='9' | '@' => true,
7474
_ => false,
7575
});
7676

@@ -160,18 +160,18 @@ fn is_symbol_like(s: &str) -> bool {
160160
// Copied from the documentation of `char::is_ascii_alphanumeric`
161161
fn is_ascii_alphanumeric(c: char) -> bool {
162162
match c {
163-
'\u{0041}'...'\u{005A}' | '\u{0061}'...'\u{007A}' | '\u{0030}'...'\u{0039}' => true,
163+
'\u{0041}'..='\u{005A}' | '\u{0061}'..='\u{007A}' | '\u{0030}'..='\u{0039}' => true,
164164
_ => false,
165165
}
166166
}
167167

168168
// Copied from the documentation of `char::is_ascii_punctuation`
169169
fn is_ascii_punctuation(c: char) -> bool {
170170
match c {
171-
'\u{0021}'...'\u{002F}'
172-
| '\u{003A}'...'\u{0040}'
173-
| '\u{005B}'...'\u{0060}'
174-
| '\u{007B}'...'\u{007E}' => true,
171+
'\u{0021}'..='\u{002F}'
172+
| '\u{003A}'..='\u{0040}'
173+
| '\u{005B}'..='\u{0060}'
174+
| '\u{007B}'..='\u{007E}' => true,
175175
_ => false,
176176
}
177177
}

src/v0.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn demangle(s: &str) -> Result<(Demangle, &str), Invalid> {
3232

3333
// Paths always start with uppercase characters.
3434
match inner.as_bytes()[0] {
35-
b'A'...b'Z' => {}
35+
b'A'..=b'Z' => {}
3636
_ => return Err(Invalid),
3737
}
3838

@@ -50,7 +50,7 @@ pub fn demangle(s: &str) -> Result<(Demangle, &str), Invalid> {
5050

5151
// Instantiating crate (paths always start with uppercase characters).
5252
match parser.sym.as_bytes().get(parser.next) {
53-
Some(&b'A'...b'Z') => {
53+
Some(&(b'A'..=b'Z')) => {
5454
try!(parser.skip_path());
5555
}
5656
_ => {}
@@ -159,8 +159,8 @@ impl<'s> Ident<'s> {
159159
let t = min(max(k.saturating_sub(bias), t_min), t_max);
160160

161161
let d = match punycode_bytes.next() {
162-
Some(d @ b'a'...b'z') => d - b'a',
163-
Some(d @ b'0'...b'9') => 26 + (d - b'0'),
162+
Some(d @ b'a'..=b'z') => d - b'a',
163+
Some(d @ b'0'..=b'9') => 26 + (d - b'0'),
164164
_ => return Err(()),
165165
};
166166
let d = d as usize;
@@ -295,7 +295,7 @@ impl<'s> Parser<'s> {
295295
let start = self.next;
296296
loop {
297297
match try!(self.next()) {
298-
b'0'...b'9' | b'a'...b'f' => {}
298+
b'0'..=b'9' | b'a'..=b'f' => {}
299299
b'_' => break,
300300
_ => return Err(Invalid),
301301
}
@@ -305,7 +305,7 @@ impl<'s> Parser<'s> {
305305

306306
fn digit_10(&mut self) -> Result<u8, Invalid> {
307307
let d = match self.peek() {
308-
Some(d @ b'0'...b'9') => d - b'0',
308+
Some(d @ b'0'..=b'9') => d - b'0',
309309
_ => return Err(Invalid),
310310
};
311311
self.next += 1;
@@ -314,9 +314,9 @@ impl<'s> Parser<'s> {
314314

315315
fn digit_62(&mut self) -> Result<u8, Invalid> {
316316
let d = match self.peek() {
317-
Some(d @ b'0'...b'9') => d - b'0',
318-
Some(d @ b'a'...b'z') => 10 + (d - b'a'),
319-
Some(d @ b'A'...b'Z') => 10 + 26 + (d - b'A'),
317+
Some(d @ b'0'..=b'9') => d - b'0',
318+
Some(d @ b'a'..=b'z') => 10 + (d - b'a'),
319+
Some(d @ b'A'..=b'Z') => 10 + 26 + (d - b'A'),
320320
_ => return Err(Invalid),
321321
};
322322
self.next += 1;
@@ -351,10 +351,10 @@ impl<'s> Parser<'s> {
351351
fn namespace(&mut self) -> Result<Option<char>, Invalid> {
352352
match try!(self.next()) {
353353
// Special namespaces, like closures and shims.
354-
ns @ b'A'...b'Z' => Ok(Some(ns as char)),
354+
ns @ b'A'..=b'Z' => Ok(Some(ns as char)),
355355

356356
// Implementation-specific/unspecified namespaces.
357-
b'a'...b'z' => Ok(None),
357+
b'a'..=b'z' => Ok(None),
358358

359359
_ => Err(Invalid),
360360
}

0 commit comments

Comments
 (0)