diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-04-19 06:03:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-19 06:03:12 +0200 |
| commit | 291e44b3815b95b02bba0bf873351a2b6dfd72b9 (patch) | |
| tree | e0e7a8c70f5cfdbf4e0861c44f5c91ad67cc9fd7 /src/libcore/str | |
| parent | 7f450bd3ca9edd39b876293650d49dc17d200256 (diff) | |
| parent | 2605537012022980d5ec69ad11653794db935cf6 (diff) | |
| download | rust-291e44b3815b95b02bba0bf873351a2b6dfd72b9.tar.gz rust-291e44b3815b95b02bba0bf873351a2b6dfd72b9.zip | |
Rollup merge of #60023 - koalatux:nth-back, r=scottmcm
implement specialized nth_back() for Bytes, Fuse and Enumerate Hi, After my first PR has been successfully merged, here is my second pull request :-) Also this PR contains some specializations for the problem discussed in #54054.
Diffstat (limited to 'src/libcore/str')
| -rw-r--r-- | src/libcore/str/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index f4bb887dd29..b7e2825dd9c 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -796,6 +796,11 @@ impl DoubleEndedIterator for Bytes<'_> { } #[inline] + fn nth_back(&mut self, n: usize) -> Option<Self::Item> { + self.0.nth_back(n) + } + + #[inline] fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item> where P: FnMut(&Self::Item) -> bool { |
