Skip to content

Commit b680070

Browse files
committed
Fix instance of lint in clippy itself
1 parent 1cc1bc0 commit b680070

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/matches/single_match.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ impl<'a> PatState<'a> {
249249
let states = match self {
250250
Self::Wild => return None,
251251
Self::Other => {
252-
*self = Self::StdEnum(cx.arena.alloc_from_iter((0..adt.variants().len()).map(|_| Self::Other)));
252+
*self = Self::StdEnum(
253+
cx.arena
254+
.alloc_from_iter(std::iter::repeat_with(|| Self::Other).take(adt.variants().len())),
255+
);
253256
let Self::StdEnum(x) = self else {
254257
unreachable!();
255258
};

0 commit comments

Comments
 (0)