diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index 730009568dd3..90afd00f21db 100644 --- a/library/core/src/slice/iter.rs +++ b/library/core/src/slice/iter.rs @@ -3018,6 +3018,11 @@ where P: FnMut(&T, &T) -> bool, (1, Some(self.slice.len())) } } + + #[inline] + fn last(self) -> Option { + self.next_back() + } } #[unstable(feature = "slice_group_by", issue = "0")] @@ -3098,6 +3103,11 @@ where P: FnMut(&T, &T) -> bool, (1, Some(self.slice.len())) } } + + #[inline] + fn last(self) -> Option { + self.next_back() + } } #[unstable(feature = "slice_group_by", issue = "0")]