aboutsummaryrefslogtreecommitdiff
path: root/src/lazy_buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lazy_buffer.rs')
-rw-r--r--src/lazy_buffer.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/lazy_buffer.rs b/src/lazy_buffer.rs
index fa514ec..ca24062 100644
--- a/src/lazy_buffer.rs
+++ b/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)
}
}