We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
#[rustc_box]
Box::new
1 parent 2e2e45a commit 702a83bCopy full SHA for 702a83b
clippy_utils/src/higher.rs
@@ -287,15 +287,12 @@ impl<'a> VecArgs<'a> {
287
Some(VecArgs::Repeat(&args[0], &args[1]))
288
} else if match_def_path(cx, fun_def_id, &paths::SLICE_INTO_VEC) && args.len() == 1 {
289
// `vec![a, b, c]` case
290
- if_chain! {
291
- if let hir::ExprKind::Box(boxed) = args[0].kind;
292
- if let hir::ExprKind::Array(args) = boxed.kind;
293
- then {
294
- return Some(VecArgs::Vec(args));
295
- }
+ if let hir::ExprKind::Call(_, [arg]) = &args[0].kind
+ && let hir::ExprKind::Array(args) = arg.kind {
+ Some(VecArgs::Vec(args))
+ } else {
+ None
296
}
297
-
298
- None
299
} else if match_def_path(cx, fun_def_id, &paths::VEC_NEW) && args.is_empty() {
300
Some(VecArgs::Vec(&[]))
301
} else {
0 commit comments