diff options
Diffstat (limited to '')
-rw-r--r-- | vendor/itertools/src/lazy_buffer.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/vendor/itertools/src/lazy_buffer.rs b/vendor/itertools/src/lazy_buffer.rs index fa514ec2d..ca24062aa 100644 --- a/vendor/itertools/src/lazy_buffer.rs +++ b/vendor/itertools/src/lazy_buffer.rs @@ -28,16 +28,12 @@ where if self.done { return false; } - let next_item = self.it.next(); - match next_item { - Some(x) => { - self.buffer.push(x); - true - } - None => { - self.done = true; - false - } + if let Some(x) = self.it.next() { + self.buffer.push(x); + true + } else { + self.done = true; + false } } @@ -61,7 +57,7 @@ where { type Output = <Vec<I::Item> as Index<J>>::Output; - fn index(&self, _index: J) -> &Self::Output { - self.buffer.index(_index) + fn index(&self, index: J) -> &Self::Output { + self.buffer.index(index) } } |