mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
feat(interface-types) Simplify FlattenInterfaceValueIterator
with last_mut
.
This commit is contained in:
parent
d184ddbe37
commit
b9b5a32154
@ -156,13 +156,7 @@ impl<'a> Iterator for FlattenInterfaceValueIterator<'a> {
|
||||
type Item = &'a InterfaceValue;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.iterators.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let index = self.iterators.len() - 1;
|
||||
|
||||
match self.iterators[index].next() {
|
||||
match self.iterators.last_mut()?.next() {
|
||||
// End of the current iterator, go back to the previous
|
||||
// one.
|
||||
None => {
|
||||
|
Loading…
Reference in New Issue
Block a user