Skip to content

Commit 5ffe8a1

Browse files
committed
errors: span_suggestion takes impl ToString
Change `span_suggestion` (and variants) to take `impl ToString` rather than `String` for the suggested code, as this simplifies the requirements on the diagnostic derive. Signed-off-by: David Wood <[email protected]>
1 parent ec3afba commit 5ffe8a1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/functions/must_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn check_needless_must_use(
108108
diag.span_suggestion(
109109
attr.span,
110110
"remove the attribute",
111-
"".into(),
111+
"",
112112
Applicability::MachineApplicable,
113113
);
114114
},

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
241241
|x| Cow::from(format!("change `{}` to", x)),
242242
)
243243
.as_ref(),
244-
suggestion.into(),
244+
suggestion,
245245
Applicability::Unspecified,
246246
);
247247
}
@@ -271,7 +271,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
271271
|x| Cow::from(format!("change `{}` to", x))
272272
)
273273
.as_ref(),
274-
suggestion.into(),
274+
suggestion,
275275
Applicability::Unspecified,
276276
);
277277
}

0 commit comments

Comments
 (0)