iterator: Simplify StdIterator a bit

This commit is contained in:
Jan Alexander Steffens (heftig) 2019-09-24 11:31:28 +02:00
parent 79d3888c3d
commit eaacee49de
No known key found for this signature in database
GPG key ID: DE5E0C5F25941CA5

View file

@ -665,20 +665,13 @@ where
Some(IteratorError::Error) => return None, Some(IteratorError::Error) => return None,
// The iterator needs a resync // The iterator needs a resync
Some(IteratorError::Resync) => { Some(IteratorError::Resync) => self.inner.resync(),
self.inner.resync();
self.error = None;
}
None => {} None => {}
} }
let res = self.inner.next(); let res = self.inner.next();
self.error = res.as_ref().err().copied();
if let Err(err) = &res {
self.error = Some(*err);
}
res.transpose() res.transpose()
} }
} }