From d13cea7a135efea345ccabffb5183b5cae9f0ffe Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Mon, 21 Oct 2024 10:05:12 +0200 Subject: [PATCH] chore: Fix lints (#95) --- src/types.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/types.rs b/src/types.rs index 2acbe90..a2afdc3 100644 --- a/src/types.rs +++ b/src/types.rs @@ -328,9 +328,8 @@ impl<'a> Iterator for TokenIter<'a> { type Item = Token<'a>; fn next(&mut self) -> Option> { - self.i.get_token(self.next_idx).map(|tok| { + self.i.get_token(self.next_idx).inspect(|_| { self.next_idx += 1; - tok }) } } @@ -345,9 +344,8 @@ impl<'a> Iterator for SourceIter<'a> { type Item = &'a str; fn next(&mut self) -> Option<&'a str> { - self.i.get_source(self.next_idx).map(|source| { + self.i.get_source(self.next_idx).inspect(|_| { self.next_idx += 1; - source }) } } @@ -382,9 +380,8 @@ impl<'a> Iterator for NameIter<'a> { type Item = &'a str; fn next(&mut self) -> Option<&'a str> { - self.i.get_name(self.next_idx).map(|name| { + self.i.get_name(self.next_idx).inspect(|_| { self.next_idx += 1; - name }) } } @@ -438,9 +435,8 @@ impl<'a> Iterator for SourceMapSectionIter<'a> { type Item = &'a SourceMapSection; fn next(&mut self) -> Option<&'a SourceMapSection> { - self.i.get_section(self.next_idx).map(|sec| { + self.i.get_section(self.next_idx).inspect(|_| { self.next_idx += 1; - sec }) } }