Skip to content

Commit 883c3a0

Browse files
committed
Prefer format!
1 parent b325973 commit 883c3a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/misc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,14 +632,14 @@ fn check_cast(cx: &LateContext<'_, '_>, span: Span, e: &Expr, ty: &Ty) {
632632
};
633633

634634
if let TyKind::Infer = mut_ty.ty.kind {
635-
let sugg = String::from(sugg_fn) + "()";
635+
let sugg = format!("{}()", sugg_fn);
636636
span_lint_and_sugg(cx, ZERO_PTR, span, msg, "try", sugg, Applicability::MachineApplicable);
637637
} else if let Some(mut_ty_snip) = snippet_opt(cx, mut_ty.ty.span) {
638638
let sugg = format!("{}::<{}>()", sugg_fn, mut_ty_snip);
639639
span_lint_and_sugg(cx, ZERO_PTR, span, msg, "try", sugg, Applicability::MachineApplicable);
640640
} else {
641641
// `MaybeIncorrect` as type inference may not work with the suggested code
642-
let sugg = String::from(sugg_fn) + "()";
642+
let sugg = format!("{}()", sugg_fn);
643643
span_lint_and_sugg(cx, ZERO_PTR, span, msg, "try", sugg, Applicability::MaybeIncorrect);
644644
}
645645
}

0 commit comments

Comments
 (0)