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.
args.len() == 1
1 parent d519de6 commit 5aa8defCopy full SHA for 5aa8def
clippy_lints/src/needless_path_new.rs
@@ -106,8 +106,7 @@ fn check_arguments<'tcx>(
106
for (argument, parameter) in iter::zip(arguments, parameters) {
107
if let ExprKind::Call(func, args) = argument.kind
108
&& is_path_new(func)
109
- // I guess this check is superfluous,
110
- // since we know how many parameters `Path::new` takes
+ // just to be extra sure that we have a correctly formed `Path::new(x)` call
111
&& args.len() == 1
112
&& implements_asref_path(cx.typeck_results().expr_ty(&args[0]))
113
&& implements_asref_path(*parameter)
0 commit comments