@@ -465,10 +465,10 @@ fn format_string(v: &Vec<PyString>) -> String {
465
465
0x9 => "\\ t" . to_string( ) ,
466
466
0x5c => "\\ \\ " . to_string( ) ,
467
467
0x22 => "\\ \" " . to_string( ) ,
468
- 0x20 ... 0x7e => c. to_char( ) . unwrap( ) . to_string( ) , // unwrap can't panic
469
- 0x00 ... 0x1f | 0x7f | 0x80 ... 0xff => format!( "\\ x{:02x}" , c. to_u32( ) ) ,
470
- 0x100 ... 0xffff => format!( "\\ u{:04x}" , c. to_u32( ) ) ,
471
- 0x10000 ... 0x10ffff => format!( "\\ U{:08x}" , c. to_u32( ) ) ,
468
+ 0x20 ..= 0x7e => c. to_char( ) . unwrap( ) . to_string( ) , // unwrap can't panic
469
+ 0x00 ..= 0x1f | 0x7f | 0x80 ..= 0xff => format!( "\\ x{:02x}" , c. to_u32( ) ) ,
470
+ 0x100 ..= 0xffff => format!( "\\ u{:04x}" , c. to_u32( ) ) ,
471
+ 0x10000 ..= 0x10ffff => format!( "\\ U{:08x}" , c. to_u32( ) ) ,
472
472
_ => unreachable!( ) ,
473
473
} ) . collect:: <Vec <_>>( ) [ ..] . concat( ) )
474
474
) )
@@ -512,9 +512,8 @@ fn format_expr(e: &Expression) -> String {
512
512
b'\t' => "\\ t" . to_string( ) ,
513
513
b'\\' => "\\ \\ " . to_string( ) ,
514
514
b'"' => "\\ \" " . to_string( ) ,
515
- 0x20 ...0x7e => ( * b as char ) . to_string( ) ,
516
- 0x00 ...0x1f | 0x7f | 0x80 ...0xff => format!( "\\ x{:02x}" , b) ,
517
- _ => unreachable!( ) , // waiting for https://github.com/rust-lang/rust/pull/50912
515
+ 0x20 ..=0x7e => ( * b as char ) . to_string( ) ,
516
+ 0x00 ..=0x1f | 0x7f | 0x80 ..=0xff => format!( "\\ x{:02x}" , b) ,
518
517
} ) . collect:: <Vec <_>>( ) [ ..] . concat( ) )
519
518
} ,
520
519
0 commit comments