Skip to content

Commit f88e3ef

Browse files
Unspecialized: implement DoubleEndedIterator
1 parent b559bb5 commit f88e3ef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/specializations.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use quickcheck::{quickcheck, TestResult};
55
use std::fmt::Debug;
66

77
struct Unspecialized<I>(I);
8+
89
impl<I> Iterator for Unspecialized<I>
910
where
1011
I: Iterator,
@@ -17,6 +18,16 @@ where
1718
}
1819
}
1920

21+
impl<I> DoubleEndedIterator for Unspecialized<I>
22+
where
23+
I: DoubleEndedIterator,
24+
{
25+
#[inline(always)]
26+
fn next_back(&mut self) -> Option<Self::Item> {
27+
self.0.next_back()
28+
}
29+
}
30+
2031
fn test_specializations<IterItem, Iter>(it: &Iter)
2132
where
2233
IterItem: Eq + Debug + Clone,

0 commit comments

Comments
 (0)