Skip to content

Commit 84c7fb7

Browse files
committed
Remove redundant to_strings
1 parent 91b2efb commit 84c7fb7

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

clippy_dev/src/update_lints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ mod tests {
614614
Lint::new("should_assert_eq2", "group2", "abc", None, "module_name"),
615615
];
616616
let expected = vec![
617-
format!("[`should_assert_eq`]: {}#should_assert_eq", DOCS_LINK.to_string()),
618-
format!("[`should_assert_eq2`]: {}#should_assert_eq2", DOCS_LINK.to_string()),
617+
format!("[`should_assert_eq`]: {}#should_assert_eq", DOCS_LINK),
618+
format!("[`should_assert_eq2`]: {}#should_assert_eq2", DOCS_LINK),
619619
];
620620
assert_eq!(expected, gen_changelog_lint_list(lints.iter()));
621621
}

clippy_lints/src/inherent_to_string.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
138138
item.span,
139139
&format!(
140140
"type `{}` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`",
141-
self_type.to_string()
141+
self_type
142142
),
143143
None,
144-
&format!("remove the inherent method from type `{}`", self_type.to_string()),
144+
&format!("remove the inherent method from type `{}`", self_type),
145145
);
146146
} else {
147147
span_lint_and_help(
@@ -150,10 +150,10 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
150150
item.span,
151151
&format!(
152152
"implementation of inherent method `to_string(&self) -> String` for type `{}`",
153-
self_type.to_string()
153+
self_type
154154
),
155155
None,
156-
&format!("implement trait `Display` for type `{}` instead", self_type.to_string()),
156+
&format!("implement trait `Display` for type `{}` instead", self_type),
157157
);
158158
}
159159
}

clippy_lints/src/suspicious_operation_groupings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ fn suggestion_with_swapped_ident(
678678
Some(format!(
679679
"{}{}{}",
680680
snippet_with_applicability(cx, expr.span.with_hi(current_ident.span.lo()), "..", applicability),
681-
new_ident.to_string(),
681+
new_ident,
682682
snippet_with_applicability(cx, expr.span.with_lo(current_ident.span.hi()), "..", applicability),
683683
))
684684
})

clippy_lints/src/transmute/transmute_int_to_char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub(super) fn check<'tcx>(
3333
diag.span_suggestion(
3434
e.span,
3535
"consider using",
36-
format!("std::char::from_u32({}).unwrap()", arg.to_string()),
36+
format!("std::char::from_u32({}).unwrap()", arg),
3737
Applicability::Unspecified,
3838
);
3939
},

clippy_lints/src/transmute/transmute_int_to_float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub(super) fn check<'tcx>(
3636
diag.span_suggestion(
3737
e.span,
3838
"consider using",
39-
format!("{}::from_bits({})", to_ty, arg.to_string()),
39+
format!("{}::from_bits({})", to_ty, arg),
4040
Applicability::Unspecified,
4141
);
4242
},

0 commit comments

Comments
 (0)