Use new inclusive range pattern syntax
diff --git a/src/fallback.rs b/src/fallback.rs
index c4298d6..0e073ba 100644
--- a/src/fallback.rs
+++ b/src/fallback.rs
@@ -760,7 +760,7 @@
b'\r' => escaped.push_str(r"\r"),
b'"' => escaped.push_str("\\\""),
b'\\' => escaped.push_str("\\\\"),
- b'\x20'...b'\x7E' => escaped.push(*b as char),
+ b'\x20'..=b'\x7E' => escaped.push(*b as char),
_ => escaped.push_str(&format!("\\x{:02X}", b)),
}
}
@@ -1162,8 +1162,8 @@
where
I: Iterator<Item = (usize, char)>,
{
- next_ch!(chars @ '0'...'7');
- next_ch!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F');
+ next_ch!(chars @ '0'..='7');
+ next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
true
}
@@ -1171,8 +1171,8 @@
where
I: Iterator<Item = (usize, u8)>,
{
- next_ch!(chars @ b'0'...b'9' | b'a'...b'f' | b'A'...b'F');
- next_ch!(chars @ b'0'...b'9' | b'a'...b'f' | b'A'...b'F');
+ next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+ next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
true
}
@@ -1181,9 +1181,9 @@
I: Iterator<Item = (usize, char)>,
{
next_ch!(chars @ '{');
- next_ch!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F');
+ next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
loop {
- let c = next_ch!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F' | '_' | '}');
+ let c = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F' | '_' | '}');
if c == '}' {
return true;
}
@@ -1212,7 +1212,7 @@
let mut has_exp = false;
while let Some(&ch) = chars.peek() {
match ch {
- '0'...'9' | '_' => {
+ '0'..='9' | '_' => {
chars.next();
len += 1;
}
@@ -1257,7 +1257,7 @@
chars.next();
len += 1;
}
- '0'...'9' => {
+ '0'..='9' => {
chars.next();
len += 1;
has_exp_value = true;
@@ -1307,9 +1307,9 @@
let mut empty = true;
for b in input.bytes() {
let digit = match b {
- b'0'...b'9' => (b - b'0') as u64,
- b'a'...b'f' => 10 + (b - b'a') as u64,
- b'A'...b'F' => 10 + (b - b'A') as u64,
+ b'0'..=b'9' => (b - b'0') as u64,
+ b'a'..=b'f' => 10 + (b - b'a') as u64,
+ b'A'..=b'F' => 10 + (b - b'A') as u64,
b'_' => {
if empty && base == 10 {
return Err(LexError);
diff --git a/src/lib.rs b/src/lib.rs
index 9ad655d..72c82a3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -88,7 +88,6 @@
#![doc(html_root_url = "https://docs.rs/proc-macro2/0.4.30")]
#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
#![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))]
-#![allow(ellipsis_inclusive_range_patterns, unknown_lints)]
#[cfg(use_proc_macro)]
extern crate proc_macro;
diff --git a/src/strnom.rs b/src/strnom.rs
index 96789d5..3d8ba85 100644
--- a/src/strnom.rs
+++ b/src/strnom.rs
@@ -95,7 +95,7 @@
}
}
match bytes[i] {
- b' ' | 0x09...0x0d => {
+ b' ' | 0x09..=0x0d => {
i += 1;
continue;
}