Skip to content

Commit 563d56a

Browse files
committed
fix some more clippy lints
1 parent bb04042 commit 563d56a

File tree

5 files changed

+5
-8
lines changed

5 files changed

+5
-8
lines changed

src/adaptors/multi_product.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ where
123123
/// Returns true if iteration has started and has not yet finished; false
124124
/// otherwise.
125125
fn in_progress(&self) -> bool {
126-
self.0.last().map_or(false, |last| last.in_progress())
126+
self.0.last().map_or(false, MultiProductIter::in_progress)
127127
}
128128
}
129129

src/flatten_ok.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ where
7676
let inner_hint = |inner: &Option<T::IntoIter>| {
7777
inner
7878
.as_ref()
79-
.map(Iterator::size_hint)
80-
.unwrap_or((0, Some(0)))
79+
.map_or((0, Some(0)), Iterator::size_hint)
8180
};
8281
let inner_front = inner_hint(&self.inner_front);
8382
let inner_back = inner_hint(&self.inner_back);

src/groupbylazy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ where
112112
if client < self.oldest_buffered_group {
113113
return None;
114114
}
115-
let elt = self.buffer.get_mut(bufidx).and_then(|queue| queue.next());
115+
let elt = self.buffer.get_mut(bufidx).and_then(Iterator::next);
116116
if elt.is_none() && client == self.oldest_buffered_group {
117117
// FIXME: VecDeque is unfortunately not zero allocation when empty,
118118
// so we do this job manually.

src/kmerge_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ where
226226
#[allow(deprecated)] //TODO: once msrv hits 1.51. replace `fold1` with `reduce`
227227
self.heap
228228
.iter()
229-
.map(|i| i.size_hint())
229+
.map(HeadTail::size_hint)
230230
.fold1(size_hint::add)
231231
.unwrap_or((0, Some(0)))
232232
}

src/unique_impl.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ use std::iter::FusedIterator;
1111
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
1212
pub struct UniqueBy<I: Iterator, V, F> {
1313
iter: I,
14-
// Use a Hashmap for the Entry API in order to prevent hashing twice.
15-
// This can maybe be replaced with a HashSet once `get_or_insert_with`
16-
// or a proper Entry API for Hashset is stable and meets this msrv
14+
// see comment for `allow(clippy::zero_sized_map_values)` for reasoning
1715
used: HashMap<V, ()>,
1816
f: F,
1917
}

0 commit comments

Comments
 (0)