about summary refs log tree commit diff
path: root/src/libcore/str
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-19 06:03:12 +0200
committerGitHub <noreply@github.com>2019-04-19 06:03:12 +0200
commit291e44b3815b95b02bba0bf873351a2b6dfd72b9 (patch)
treee0e7a8c70f5cfdbf4e0861c44f5c91ad67cc9fd7 /src/libcore/str
parent7f450bd3ca9edd39b876293650d49dc17d200256 (diff)
parent2605537012022980d5ec69ad11653794db935cf6 (diff)
downloadrust-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.rs5
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
     {