mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
Implement nth, last, and count for iter::Copied
This commit is contained in:
parent
7ac21e7636
commit
85cbabba63
@ -173,6 +173,18 @@ impl<'a, I, T: 'a> Iterator for Copied<I>
|
||||
{
|
||||
self.it.fold(init, copy_fold(f))
|
||||
}
|
||||
|
||||
fn nth(&mut self, n: usize) -> Option<T> {
|
||||
self.it.nth(n).copied()
|
||||
}
|
||||
|
||||
fn last(self) -> Option<T> {
|
||||
self.it.last().copied()
|
||||
}
|
||||
|
||||
fn count(self) -> usize {
|
||||
self.it.count()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "iter_copied", since = "1.36.0")]
|
||||
|
Loading…
Reference in New Issue
Block a user