File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ lazy_static! {
6969 add!( HEXUPPER_PERMISSIVE ) ;
7070 map
7171 } ;
72- static ref TOP_BUTTONS : HashMap <String , Box <Fn ( ) -> JsValue + Sync >> = {
73- let mut result: HashMap <String , Box <Fn ( ) -> JsValue + Sync >> = HashMap :: new( ) ;
72+ static ref TOP_BUTTONS : HashMap <String , Box <dyn Fn ( ) -> JsValue + Sync >> = {
73+ let mut result: HashMap <String , Box <dyn Fn ( ) -> JsValue + Sync >> = HashMap :: new( ) ;
7474 result. insert( "tutorial" . to_string( ) , Box :: new( || create_tutorial( ) ) ) ;
7575 result. insert( "settings" . to_string( ) , Box :: new( || create_settings( ) ) ) ;
7676 result. insert( "help" . to_string( ) , Box :: new( || create_help( ) ) ) ;
Original file line number Diff line number Diff line change @@ -2,17 +2,17 @@ use std::str::from_utf8;
22
33fn to_hex ( x : u8 ) -> char {
44 ( match x {
5- 0 ... 9 => b'0' + x,
6- 10 ... 15 => b'a' + x - 10 ,
5+ 0 ..= 9 => b'0' + x,
6+ 10 ..= 15 => b'a' + x - 10 ,
77 _ => panic ! ( ) ,
88 } ) as char
99}
1010
1111fn from_hex ( x : u8 ) -> u8 {
1212 match x {
13- b'0' ... b'9' => x - b'0' ,
14- b'A' ... b'F' => x - b'A' + 10 ,
15- b'a' ... b'f' => x - b'a' + 10 ,
13+ b'0' ..= b'9' => x - b'0' ,
14+ b'A' ..= b'F' => x - b'A' + 10 ,
15+ b'a' ..= b'f' => x - b'a' + 10 ,
1616 _ => panic ! ( ) ,
1717 }
1818}
@@ -49,7 +49,7 @@ pub fn encode(input: &[u8], whitespace: bool) -> String {
4949 }
5050 }
5151 '\t' | '\r' | '\\' => escape_char ( c, & mut result) ,
52- '\x00' ... '\x1f' | '\x7f' => escape_byte ( c as u8 , & mut result) ,
52+ '\x00' ..= '\x1f' | '\x7f' => escape_byte ( c as u8 , & mut result) ,
5353 _ => result. push ( c) ,
5454 }
5555 }
You can’t perform that action at this time.
0 commit comments