Skip to content

Commit 24804d3

Browse files
smoeliuscamsteffen
andcommitted
Update clippy_lints/src/format_args.rs
Co-authored-by: Cameron Steffen <cam.steffen94@gmail.com>
1 parent 72ea622 commit 24804d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/format_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn check_to_string_in_format_args<'tcx>(
118118
if_chain! {
119119
if let ExprKind::MethodCall(_, _, [receiver], span) = value.kind;
120120
if let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(value.hir_id);
121-
if match_def_path(cx, method_def_id, &paths::TO_STRING_METHOD);
121+
if is_diag_trait_item(cx, method_def_id, sym::ToString);
122122
if let Some(receiver) = args.get(0);
123123
let ty = cx.typeck_results().expr_ty(receiver);
124124
if let Some(display_trait_id) = get_trait_def_id(cx, &paths::DISPLAY_TRAIT);

0 commit comments

Comments
 (0)