summaryrefslogtreecommitdiffstats
path: root/grep-cli
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2019-06-16 18:37:51 -0400
committerAndrew Gallant <jamslam@gmail.com>2019-06-16 18:37:51 -0400
commit7b9972c30876797103d6b51c14dd8f9bf1001c92 (patch)
treefa4e1c6c75c23de5a5552470d173e02d78bd5575 /grep-cli
parent9f000c29109cf369c4c28254f0cf9b9216a1950d (diff)
style: fix deprecations
Use `dyn` for trait objects and use `..=` for inclusive ranges.
Diffstat (limited to 'grep-cli')
-rw-r--r--grep-cli/src/escape.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/grep-cli/src/escape.rs b/grep-cli/src/escape.rs
index 7ea96788..6b4d2d3c 100644
--- a/grep-cli/src/escape.rs
+++ b/grep-cli/src/escape.rs
@@ -111,7 +111,7 @@ pub fn unescape(s: &str) -> Vec<u8> {
}
HexFirst => {
match c {
- '0'...'9' | 'A'...'F' | 'a'...'f' => {
+ '0'..='9' | 'A'..='F' | 'a'..='f' => {
state = HexSecond(c);
}
c => {
@@ -122,7 +122,7 @@ pub fn unescape(s: &str) -> Vec<u8> {
}
HexSecond(first) => {
match c {
- '0'...'9' | 'A'...'F' | 'a'...'f' => {
+ '0'..='9' | 'A'..='F' | 'a'..='f' => {
let ordinal = format!("{}{}", first, c);
let byte = u8::from_str_radix(&ordinal, 16).unwrap();
bytes.push(byte);
@@ -174,7 +174,7 @@ fn escape_char(cp: char, into: &mut String) {
/// Adds the given byte to the given string, escaping it if necessary.
fn escape_byte(byte: u8, into: &mut String) {
match byte {
- 0x21...0x5B | 0x5D...0x7D => into.push(byte as char),
+ 0x21..=0x5B | 0x5D..=0x7D => into.push(byte as char),
b'\n' => into.push_str(r"\n"),
b'\r' => into.push_str(r"\r"),
b'\t' => into.push_str(r"\t"),