Replace all format!("{}", foo) calls
This commit is contained in:
parent
ef4401d4ac
commit
b6443b9928
5 changed files with 14 additions and 16 deletions
|
|
@ -530,10 +530,10 @@ fn lint_or_fun_call(cx: &LateContext, expr: &Expr, name: &str, args: &[P<Expr>])
|
|||
return;
|
||||
}
|
||||
|
||||
let sugg = match (fn_has_arguments, !or_has_args) {
|
||||
(true, _) => format!("|_| {}", snippet(cx, arg.span, "..")),
|
||||
(false, false) => format!("|| {}", snippet(cx, arg.span, "..")),
|
||||
(false, true) => format!("{}", snippet(cx, fun.span, "..")),
|
||||
let sugg: Cow<_> = match (fn_has_arguments, !or_has_args) {
|
||||
(true, _) => format!("|_| {}", snippet(cx, arg.span, "..")).into(),
|
||||
(false, false) => format!("|| {}", snippet(cx, arg.span, "..")).into(),
|
||||
(false, true) => snippet(cx, fun.span, ".."),
|
||||
};
|
||||
|
||||
span_lint(cx, OR_FUN_CALL, span, &format!("use of `{}` followed by a function call", name))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue