From 0eb4aaac1e9dd5ceefe1f2b36b398e8128036db4 Mon Sep 17 00:00:00 2001 From: Bojan Durdevic Date: Fri, 15 Oct 2021 21:37:51 -0400 Subject: [PATCH] Line range minus syntax clippy suggestions addressed --- src/line_range.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/line_range.rs b/src/line_range.rs index 8cf72095..6ecd3439 100644 --- a/src/line_range.rs +++ b/src/line_range.rs @@ -56,14 +56,14 @@ impl LineRange { new_range.lower + more_lines } else if first_byte == Some(b'-') { // this will prevent values like "-+5" even though "+5" is valid integer - if &line_numbers[1][1..].bytes().next() == &Some(b'+') { + if line_numbers[1][1..].bytes().next() == Some(b'+') { return Err("Invalid character after -".into()); } - let less_lines = &line_numbers[1][1..] + let prior_lines = &line_numbers[1][1..] .parse() .map_err(|_| "Invalid character after -")?; let prev_lower = new_range.lower; - new_range.lower = new_range.lower - less_lines; + new_range.lower -= prior_lines; prev_lower } else { line_numbers[1].parse()?