mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-02 01:40:29 +08:00
git-ref-format: DoubleEndedIterator for Components
Add DoubleEndedIterator implementations for the two Components iterators. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -34,6 +34,17 @@ impl<'a> Iterator for Components<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> DoubleEndedIterator for Components<'a> {
|
||||
#[inline]
|
||||
fn next_back(&mut self) -> Option<Self::Item> {
|
||||
self.inner
|
||||
.next_back()
|
||||
.map(RefStr::from_str)
|
||||
.map(Cow::from)
|
||||
.map(Component)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a RefStr> for Components<'a> {
|
||||
#[inline]
|
||||
fn from(rs: &'a RefStr) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user