Skip to content

Commit 4ee6f58

Browse files
committed
Fix instance of lint in clippy itself
1 parent 3ce068e commit 4ee6f58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/matches/single_match.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ impl<'a> PatState<'a> {
226226
let states = match self {
227227
Self::Wild => return None,
228228
Self::Other => {
229-
*self = Self::StdEnum(cx.arena.alloc_from_iter((0..adt.variants().len()).map(|_| Self::Other)));
229+
*self = Self::StdEnum(
230+
cx.arena
231+
.alloc_from_iter(std::iter::repeat_with(|| Self::Other).take(adt.variants().len())),
232+
);
230233
let Self::StdEnum(x) = self else {
231234
unreachable!();
232235
};

0 commit comments

Comments
 (0)