Skip to content

Commit ba3ef6f

Browse files
committed
fix clippy::manual_map in tests
1 parent f004e22 commit ba3ef6f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/test_core.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,10 @@ fn batching() {
180180
let ys = [(0, 1), (2, 1)];
181181

182182
// An iterator that gathers elements up in pairs
183-
let pit = xs.iter().cloned().batching(|it| {
184-
match it.next() {
185-
None => None,
186-
Some(x) => match it.next() {
187-
None => None,
188-
Some(y) => Some((x, y)),
189-
}
190-
}
191-
});
183+
let pit = xs
184+
.iter()
185+
.cloned()
186+
.batching(|it| it.next().and_then(|x| it.next().map(|y| (x, y))));
192187
it::assert_equal(pit, ys.iter().cloned());
193188
}
194189

0 commit comments

Comments
 (0)