From c7f3d56dd064295a09187771acf8fe1082cfda12 Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Sun, 21 May 2023 17:32:55 -0700 Subject: [PATCH] lint: `clippy::range_plus_one` lint violations --- src/ext_slice.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ext_slice.rs b/src/ext_slice.rs index c81ba54..4b6753c 100644 --- a/src/ext_slice.rs +++ b/src/ext_slice.rs @@ -3744,7 +3744,7 @@ impl<'a> Iterator for LinesWithTerminator<'a> { Some(line) } Some(end) => { - let line = &self.bytes[..end + 1]; + let line = &self.bytes[..=end]; self.bytes = &self.bytes[end + 1..]; Some(line) } @@ -3764,7 +3764,7 @@ impl<'a> DoubleEndedIterator for LinesWithTerminator<'a> { } Some(end) => { let line = &self.bytes[end + 1..]; - self.bytes = &self.bytes[..end + 1]; + self.bytes = &self.bytes[..=end]; Some(line) } }