Closed
Description
Now that Iterator
has re-emerged as a single trait, it's possible to override default methods like count
, last
and nth
for iterators on slices, vectors, and so on. We should audit the applicable iterators and take advantage of overrides when possible.
libcore:
- slice::Iter(Mut): count, last, nth
- slice::Windows: count, last, nth O(1) count,nth,last for slice::{Windows,Chunks,ChunksMut} #27652
- slice::Chunks(Mut): count, last, nth O(1) count,nth,last for slice::{Windows,Chunks,ChunksMut} #27652
- char::{EscapeDefault, EscapeUnicode}: count, last, nth (techically but probably not worth it)
- str::Bytes: count, last, nth
- iter::Chain: count, last, nth
- iter::Enumerate: count, nth
- iter::Peekable: count, last, nth
- iter::Skip: count, last, next (should call nth), nth
- iter::Take: nth
- iter::Fuse: count, last, nth