Indicate the anonymous lifetime of the GroupBy and GroupByMut

This commit is contained in:
Clément Renault 2020-12-10 11:47:15 +01:00
parent 0ebf8e13f0
commit 6a5a60048d
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -1233,7 +1233,7 @@ impl<T> [T] {
/// ```
#[unstable(feature = "slice_group_by", issue = "none")]
#[inline]
pub fn group_by<F>(&self, pred: F) -> GroupBy<T, F>
pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>
where F: FnMut(&T, &T) -> bool
{
GroupBy::new(self, pred)
@ -1262,7 +1262,7 @@ impl<T> [T] {
/// ```
#[unstable(feature = "slice_group_by", issue = "none")]
#[inline]
pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<T, F>
pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>
where F: FnMut(&T, &T) -> bool
{
GroupByMut::new(self, pred)