Skip to content

Commit 4837fb4

Browse files
committed
implement nth_back for Box
1 parent eac0908 commit 4837fb4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/liballoc/boxed.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,9 @@ impl<I: DoubleEndedIterator + ?Sized> DoubleEndedIterator for Box<I> {
662662
fn next_back(&mut self) -> Option<I::Item> {
663663
(**self).next_back()
664664
}
665+
fn nth_back(&mut self, n: usize) -> Option<I::Item> {
666+
(**self).nth_back(n)
667+
}
665668
}
666669
#[stable(feature = "rust1", since = "1.0.0")]
667670
impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {

src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
#![feature(maybe_uninit)]
116116
#![feature(alloc_layout_extra)]
117117
#![feature(try_trait)]
118+
#![feature(iter_nth_back)]
118119

119120
// Allow testing this library
120121

0 commit comments

Comments
 (0)