Skip to content

Commit

Permalink
Implement DoubleEndedIterator for Unwrap when appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey committed Aug 18, 2023
1 parent 485e1f8 commit 3e3d205
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2640,6 +2640,17 @@ where
}
}

impl<T> iter::DoubleEndedIterator for Unwrap<T>
where
T: DoubleEndedFallibleIterator,
T::Error: core::fmt::Debug,
{
#[inline]
fn next_back(&mut self) -> Option<T::Item> {
self.0.next_back().unwrap()
}
}

fn _is_object_safe(_: &dyn DoubleEndedFallibleIterator<Item = (), Error = ()>) {}

/// An extnsion-trait with set of useful methods to convert [`core::iter::Iterator`]
Expand Down

0 comments on commit 3e3d205

Please sign in to comment.