mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Rollup merge of #69625 - Stebalien:feat/iter-copy-specialize, r=KodrAus
Implement nth, last, and count for iter::Copied Implement nth, last and count for iter::Copied.
This commit is contained in:
commit
25091ed9b7
@ -200,6 +200,18 @@ where
|
||||
{
|
||||
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