Skip to content

Commit e1490ce

Browse files
committed
fix clippy::needless_borrow
1 parent ca28006 commit e1490ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/grouping_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl<I, K, V> GroupingMap<I>
289289
where F: FnMut(&K, &V) -> CK,
290290
CK: Ord,
291291
{
292-
self.max_by(|key, v1, v2| f(key, &v1).cmp(&f(key, &v2)))
292+
self.max_by(|key, v1, v2| f(key, v1).cmp(&f(key, v2)))
293293
}
294294

295295
/// Groups elements from the `GroupingMap` source by key and finds the minimum of each group.
@@ -367,7 +367,7 @@ impl<I, K, V> GroupingMap<I>
367367
where F: FnMut(&K, &V) -> CK,
368368
CK: Ord,
369369
{
370-
self.min_by(|key, v1, v2| f(key, &v1).cmp(&f(key, &v2)))
370+
self.min_by(|key, v1, v2| f(key, v1).cmp(&f(key, v2)))
371371
}
372372

373373
/// Groups elements from the `GroupingMap` source by key and find the maximum and minimum of
@@ -480,7 +480,7 @@ impl<I, K, V> GroupingMap<I>
480480
where F: FnMut(&K, &V) -> CK,
481481
CK: Ord,
482482
{
483-
self.minmax_by(|key, v1, v2| f(key, &v1).cmp(&f(key, &v2)))
483+
self.minmax_by(|key, v1, v2| f(key, v1).cmp(&f(key, v2)))
484484
}
485485

486486
/// Groups elements from the `GroupingMap` source by key and sums them.

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ pub trait Itertools : Iterator {
17971797
Some(if predicate(&first) {
17981798
first
17991799
} else {
1800-
self.find(|x| predicate(&x)).unwrap_or(first)
1800+
self.find(|x| predicate(x)).unwrap_or(first)
18011801
})
18021802
}
18031803
/// Returns `true` if the given item is present in this iterator.

0 commit comments

Comments
 (0)