Skip to content

Commit c6aed63

Browse files
committed
www: Fix warnings
1 parent a6ba5bb commit c6aed63

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

www/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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()));

www/src/utf8.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ use std::str::from_utf8;
22

33
fn 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

1111
fn 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
}

0 commit comments

Comments
 (0)