Implement last on the GroupBy and GroupByMut Iterators

This commit is contained in:
Clément Renault 2020-12-10 11:22:29 +01:00
parent e16eaeaa11
commit 005912fce8
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -3018,6 +3018,11 @@ where P: FnMut(&T, &T) -> bool,
(1, Some(self.slice.len()))
}
}
#[inline]
fn last(self) -> Option<Self::Item> {
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::Item> {
self.next_back()
}
}
#[unstable(feature = "slice_group_by", issue = "0")]