implement nth_back for Box

This commit is contained in:
Adrian Friedli 2019-02-16 22:34:28 +01:00
parent eac09088e1
commit 4837fb45ff
No known key found for this signature in database
GPG key ID: 72488301A5824477
2 changed files with 4 additions and 0 deletions

View file

@ -662,6 +662,9 @@ impl<I: DoubleEndedIterator + ?Sized> DoubleEndedIterator for Box<I> {
fn next_back(&mut self) -> Option<I::Item> {
(**self).next_back()
}
fn nth_back(&mut self, n: usize) -> Option<I::Item> {
(**self).nth_back(n)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {

View file

@ -115,6 +115,7 @@
#![feature(maybe_uninit)]
#![feature(alloc_layout_extra)]
#![feature(try_trait)]
#![feature(iter_nth_back)]
// Allow testing this library