diff options
| author | Steven Fackler <sfackler@palantir.com> | 2019-05-22 14:09:34 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@palantir.com> | 2019-05-22 14:09:34 -0700 |
| commit | 8a22bc3b30e81568db25cf57aa9e7629bfa449c7 (patch) | |
| tree | 8af1ae41d65496ea74a1a45a43dac5dbd11a2d59 /src/libcore | |
| parent | 37ff5d388f8c004ca248adb635f1cc84d347eda0 (diff) | |
| download | rust-8a22bc3b30e81568db25cf57aa9e7629bfa449c7.tar.gz rust-8a22bc3b30e81568db25cf57aa9e7629bfa449c7.zip | |
Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators."
This reverts commit 3e86cf36b5114f201868bf459934fe346a76a2d4.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/ascii.rs | 2 | ||||
| -rw-r--r-- | src/libcore/iter/adapters/mod.rs | 5 | ||||
| -rw-r--r-- | src/libcore/slice/mod.rs | 20 | ||||
| -rw-r--r-- | src/libcore/str/mod.rs | 20 |
4 files changed, 0 insertions, 47 deletions
diff --git a/src/libcore/ascii.rs b/src/libcore/ascii.rs index ddee02ea232..c0ab364380f 100644 --- a/src/libcore/ascii.rs +++ b/src/libcore/ascii.rs @@ -117,8 +117,6 @@ impl Iterator for EscapeDefault { type Item = u8; fn next(&mut self) -> Option<u8> { self.range.next().map(|i| self.data[i]) } fn size_hint(&self) -> (usize, Option<usize>) { self.range.size_hint() } - #[inline] - fn last(mut self) -> Option<u8> { self.next_back() } } #[stable(feature = "rust1", since = "1.0.0")] impl DoubleEndedIterator for EscapeDefault { diff --git a/src/libcore/iter/adapters/mod.rs b/src/libcore/iter/adapters/mod.rs index 64e588f65b4..518442efe74 100644 --- a/src/libcore/iter/adapters/mod.rs +++ b/src/libcore/iter/adapters/mod.rs @@ -73,11 +73,6 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator { { self.iter.position(predicate) } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index d06d107d32a..50d2ba0d3ef 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -3547,11 +3547,6 @@ impl<'a, T, P> Iterator for Split<'a, T, P> where P: FnMut(&T) -> bool { (1, Some(self.v.len() + 1)) } } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "rust1", since = "1.0.0")] @@ -3650,11 +3645,6 @@ impl<'a, T, P> Iterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool { (1, Some(self.v.len() + 1)) } } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "rust1", since = "1.0.0")] @@ -3720,11 +3710,6 @@ impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool { fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "slice_rsplit", since = "1.27.0")] @@ -3789,11 +3774,6 @@ impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool { fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "slice_rsplit", since = "1.27.0")] diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 0e8a2da3c11..ef4bd83cbc5 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1333,11 +1333,6 @@ impl<'a> Iterator for Lines<'a> { fn size_hint(&self) -> (usize, Option<usize>) { self.0.size_hint() } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "rust1", since = "1.0.0")] @@ -1384,11 +1379,6 @@ impl<'a> Iterator for LinesAny<'a> { fn size_hint(&self) -> (usize, Option<usize>) { self.0.size_hint() } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "rust1", since = "1.0.0")] @@ -4231,11 +4221,6 @@ impl<'a> Iterator for SplitWhitespace<'a> { fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "split_whitespace", since = "1.1.0")] @@ -4262,11 +4247,6 @@ impl<'a> Iterator for SplitAsciiWhitespace<'a> { fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } - - #[inline] - fn last(mut self) -> Option<Self::Item> { - self.next_back() - } } #[stable(feature = "split_ascii_whitespace", since = "1.34.0")] |
