From 4837fb45ff41ad8ff4c6dfc9bd3f8056959f3d4e Mon Sep 17 00:00:00 2001 From: Adrian Friedli Date: Sat, 16 Feb 2019 22:34:28 +0100 Subject: implement nth_back for Box --- src/liballoc/boxed.rs | 3 +++ src/liballoc/lib.rs | 1 + 2 files changed, 4 insertions(+) (limited to 'src/liballoc') diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 51549f92d4d..1e3ccf90eb8 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -662,6 +662,9 @@ impl DoubleEndedIterator for Box { fn next_back(&mut self) -> Option { (**self).next_back() } + fn nth_back(&mut self, n: usize) -> Option { + (**self).nth_back(n) + } } #[stable(feature = "rust1", since = "1.0.0")] impl ExactSizeIterator for Box { diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 95b9dacf856..da1afc2ff8a 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -115,6 +115,7 @@ #![feature(maybe_uninit)] #![feature(alloc_layout_extra)] #![feature(try_trait)] +#![feature(iter_nth_back)] // Allow testing this library -- cgit 1.4.1-3-g733a5