@@ -32,7 +32,7 @@ pub fn demangle(s: &str) -> Result<(Demangle, &str), Invalid> {
32
32
33
33
// Paths always start with uppercase characters.
34
34
match inner. as_bytes ( ) [ 0 ] {
35
- b'A' ... b'Z' => { }
35
+ b'A' ..= b'Z' => { }
36
36
_ => return Err ( Invalid ) ,
37
37
}
38
38
@@ -50,7 +50,7 @@ pub fn demangle(s: &str) -> Result<(Demangle, &str), Invalid> {
50
50
51
51
// Instantiating crate (paths always start with uppercase characters).
52
52
match parser. sym . as_bytes ( ) . get ( parser. next ) {
53
- Some ( & b'A' ... b'Z' ) => {
53
+ Some ( & ( b'A' ..= b'Z' ) ) => {
54
54
try!( parser. skip_path ( ) ) ;
55
55
}
56
56
_ => { }
@@ -159,8 +159,8 @@ impl<'s> Ident<'s> {
159
159
let t = min ( max ( k. saturating_sub ( bias) , t_min) , t_max) ;
160
160
161
161
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' ) ,
164
164
_ => return Err ( ( ) ) ,
165
165
} ;
166
166
let d = d as usize ;
@@ -295,7 +295,7 @@ impl<'s> Parser<'s> {
295
295
let start = self . next ;
296
296
loop {
297
297
match try!( self . next ( ) ) {
298
- b'0' ... b'9' | b'a' ... b'f' => { }
298
+ b'0' ..= b'9' | b'a' ..= b'f' => { }
299
299
b'_' => break ,
300
300
_ => return Err ( Invalid ) ,
301
301
}
@@ -305,7 +305,7 @@ impl<'s> Parser<'s> {
305
305
306
306
fn digit_10 ( & mut self ) -> Result < u8 , Invalid > {
307
307
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' ,
309
309
_ => return Err ( Invalid ) ,
310
310
} ;
311
311
self . next += 1 ;
@@ -314,9 +314,9 @@ impl<'s> Parser<'s> {
314
314
315
315
fn digit_62 ( & mut self ) -> Result < u8 , Invalid > {
316
316
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' ) ,
320
320
_ => return Err ( Invalid ) ,
321
321
} ;
322
322
self . next += 1 ;
@@ -351,10 +351,10 @@ impl<'s> Parser<'s> {
351
351
fn namespace ( & mut self ) -> Result < Option < char > , Invalid > {
352
352
match try!( self . next ( ) ) {
353
353
// 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 ) ) ,
355
355
356
356
// Implementation-specific/unspecified namespaces.
357
- b'a' ... b'z' => Ok ( None ) ,
357
+ b'a' ..= b'z' => Ok ( None ) ,
358
358
359
359
_ => Err ( Invalid ) ,
360
360
}
0 commit comments