Skip to content

Commit 215742d

Browse files
committed
Adopt ..= range syntax in html5ever
This is starts to become a warning in rustc 1.37.0
1 parent 59758c5 commit 215742d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

html5ever/src/tokenizer/char_ref/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,14 @@ impl CharRefTokenizer {
244244

245245
let (c, error) = match self.num {
246246
n if (n > 0x10FFFF) || self.num_too_big => ('\u{fffd}', true),
247-
0x00 | 0xD800...0xDFFF => ('\u{fffd}', true),
247+
0x00 | 0xD800..=0xDFFF => ('\u{fffd}', true),
248248

249-
0x80...0x9F => match data::C1_REPLACEMENTS[(self.num - 0x80) as usize] {
249+
0x80..=0x9F => match data::C1_REPLACEMENTS[(self.num - 0x80) as usize] {
250250
Some(c) => (c, true),
251251
None => (conv(self.num), true),
252252
},
253253

254-
0x01...0x08 | 0x0B | 0x0D...0x1F | 0x7F | 0xFDD0...0xFDEF => (conv(self.num), true),
254+
0x01..=0x08 | 0x0B | 0x0D..=0x1F | 0x7F | 0xFDD0..=0xFDEF => (conv(self.num), true),
255255

256256
n if (n & 0xFFFE) == 0xFFFE => (conv(n), true),
257257

html5ever/src/tokenizer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
264264

265265
if self.opts.exact_errors &&
266266
match c as u32 {
267-
0x01...0x08 | 0x0B | 0x0E...0x1F | 0x7F...0x9F | 0xFDD0...0xFDEF => true,
267+
0x01..=0x08 | 0x0B | 0x0E..=0x1F | 0x7F..=0x9F | 0xFDD0..=0xFDEF => true,
268268
n if (n & 0xFFFE) == 0xFFFE => true,
269269
_ => false,
270270
}

html5ever/src/util/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ pub fn to_escaped_string<T: fmt::Debug>(x: &T) -> String {
1919
/// letter, otherwise None.
2020
pub fn lower_ascii_letter(c: char) -> Option<char> {
2121
match c {
22-
'a'...'z' => Some(c),
23-
'A'...'Z' => Some((c as u8 - b'A' + b'a') as char),
22+
'a'..='z' => Some(c),
23+
'A'..='Z' => Some((c as u8 - b'A' + b'a') as char),
2424
_ => None,
2525
}
2626
}
2727

2828
/// Is the character an ASCII alphanumeric character?
2929
pub fn is_ascii_alnum(c: char) -> bool {
30-
matches!(c, '0'...'9' | 'a'...'z' | 'A'...'Z')
30+
matches!(c, '0'..='9' | 'a'..='z' | 'A'..='Z')
3131
}
3232

3333
/// ASCII whitespace characters, as defined by

0 commit comments

Comments
 (0)