diff options
| author | Adrian Friedli <adi@koalatux.ch> | 2019-02-16 22:34:28 +0100 |
|---|---|---|
| committer | Adrian Friedli <adi@koalatux.ch> | 2019-02-16 22:34:28 +0100 |
| commit | 4837fb45ff41ad8ff4c6dfc9bd3f8056959f3d4e (patch) | |
| tree | d3cd5b1e6e72c9a50e7852b64af187ec67e4186b /src/liballoc | |
| parent | eac09088e1a8fc8a293028764e4e84da29469205 (diff) | |
| download | rust-4837fb45ff41ad8ff4c6dfc9bd3f8056959f3d4e.tar.gz rust-4837fb45ff41ad8ff4c6dfc9bd3f8056959f3d4e.zip | |
implement nth_back for Box
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 3 | ||||
| -rw-r--r-- | src/liballoc/lib.rs | 1 |
2 files changed, 4 insertions, 0 deletions
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<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> { 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 |
