Skip to content

Commit bbe21e3

Browse files
committed
Use ..= instead of ... for inclusive ranges.
1 parent c3b5838 commit bbe21e3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

xml-schema/src/primitives.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,21 +254,21 @@ impl<'input> ParseXmlStr<'input> for Integer<'input> {
254254
match c {
255255
'+' => multiplier = 1,
256256
'-' => multiplier = -1,
257-
'0'...'9' => n = (c as i64) - ('0' as i64),
257+
'0'..='9' => n = (c as i64) - ('0' as i64),
258258
_ => return None,
259259
}
260260

261261
if c == '+' || c == '-' {
262262
let c = iter.next()?.1;
263263
match c {
264-
'0'...'9' => n = (c as i64) - ('0' as i64),
264+
'0'..='9' => n = (c as i64) - ('0' as i64),
265265
_ => return None,
266266
}
267267
}
268268

269269
for (i,c) in iter {
270270
match c {
271-
'0'...'9' => n = n * 10 + ((c as i64) - ('0' as i64)),
271+
'0'..='9' => n = n * 10 + ((c as i64) - ('0' as i64)),
272272
_ => {
273273
let res = multiplier * n;
274274
validate_int!(res, facets);

xml-schema/src/xml_utils.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[inline(always)]
33
pub fn is_xml_char(c: char) -> bool {
44
match c as u32 {
5-
0x0...0xD7FF | 0xE000...0xFFFD | 0x10000...0x10FFFF => true,
5+
0x0..=0xD7FF | 0xE000..=0xFFFD | 0x10000..=0x10FFFF => true,
66
0xFFFE | 0xFFFF => false,
77
_ => unreachable!(),
88
}
@@ -12,10 +12,10 @@ pub fn is_xml_char(c: char) -> bool {
1212
#[inline(always)]
1313
pub fn is_name_start_char(c: char) -> bool {
1414
match c {
15-
':' | 'A'...'Z' | '_' | 'a'...'z' | '\u{C0}'...'\u{D6}' | '\u{F8}'...'\u{2FF}' |
16-
'\u{370}'...'\u{1FFF}' | '\u{200C}'...'\u{200D}' | '\u{2070}'...'\u{218F}' |
17-
'\u{2C00}'...'\u{2FEF}' | '\u{3001}'...'\u{D7FF}' | '\u{F900}'...'\u{FDCF}' |
18-
'\u{FDF0}'...'\u{FFFD}' | '\u{10000}'...'\u{EFFFF}' => true,
15+
':' | 'A'..='Z' | '_' | 'a'..='z' | '\u{C0}'..='\u{D6}' | '\u{F8}'..='\u{2FF}' |
16+
'\u{370}'..='\u{1FFF}' | '\u{200C}'..='\u{200D}' | '\u{2070}'..='\u{218F}' |
17+
'\u{2C00}'..='\u{2FEF}' | '\u{3001}'..='\u{D7FF}' | '\u{F900}'..='\u{FDCF}' |
18+
'\u{FDF0}'..='\u{FFFD}' | '\u{10000}'..='\u{EFFFF}' => true,
1919
_ => false,
2020
}
2121
}
@@ -24,8 +24,8 @@ pub fn is_name_start_char(c: char) -> bool {
2424
#[inline(always)]
2525
pub fn is_name_char(c: char) -> bool {
2626
match c {
27-
'-' | '.' | '0'...'9' | '\u{B7}' | '\u{0300}'...'\u{036F}' |
28-
'\u{203F}'...'\u{2040}' => true,
27+
'-' | '.' | '0'..='9' | '\u{B7}' | '\u{0300}'..='\u{036F}' |
28+
'\u{203F}'..='\u{2040}' => true,
2929
_ => is_name_start_char(c),
3030
}
3131
}

0 commit comments

Comments
 (0)