We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8184e4c + 590fdef commit 3e92550Copy full SHA for 3e92550
src/peeking_take_while.rs
@@ -16,7 +16,18 @@ pub trait PeekingNext : Iterator {
16
/// if `accept` returns true, return it as the next element,
17
/// else None.
18
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item>
19
- where F: FnOnce(&Self::Item) -> bool;
+ where Self: Sized,
20
+ F: FnOnce(&Self::Item) -> bool;
21
+}
22
+
23
+impl<'a, I> PeekingNext for &'a mut I
24
+ where I: PeekingNext,
25
+{
26
+ fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item>
27
+ where F: FnOnce(&Self::Item) -> bool
28
+ {
29
+ (*self).peeking_next(accept)
30
+ }
31
}
32
33
impl<I> PeekingNext for Peekable<I>
0 commit comments