Skip to content

Commit 99fc4f5

Browse files
committed
misc: pull condition into guard
`None` is the fallback case anyway
1 parent 9aea2f5 commit 99fc4f5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

clippy_utils/src/higher.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,12 @@ impl<'a> VecArgs<'a> {
293293
// `vec![elem; size]` case
294294
Some(VecArgs::Repeat(elem, size))
295295
},
296-
(Some(sym::slice_into_vec), [slice]) => {
297-
// `vec![a, b, c]` case
296+
(Some(sym::slice_into_vec), [slice])
298297
if let ExprKind::Call(_, [arg]) = slice.kind
299-
&& let ExprKind::Array(args) = arg.kind
300-
{
301-
Some(VecArgs::Vec(args))
302-
} else {
303-
None
304-
}
298+
&& let ExprKind::Array(args) = arg.kind =>
299+
{
300+
// `vec![a, b, c]` case
301+
Some(VecArgs::Vec(args))
305302
},
306303
(Some(sym::vec_new), []) => Some(VecArgs::Vec(&[])),
307304
_ => None,

0 commit comments

Comments
 (0)