summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/clippy_lints/src/manual_strip.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/clippy_lints/src/manual_strip.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tools/clippy/clippy_lints/src/manual_strip.rs b/src/tools/clippy/clippy_lints/src/manual_strip.rs
index 7941c8c9c..0976940af 100644
--- a/src/tools/clippy/clippy_lints/src/manual_strip.rs
+++ b/src/tools/clippy/clippy_lints/src/manual_strip.rs
@@ -108,15 +108,14 @@ impl<'tcx> LateLintPass<'tcx> for ManualStrip {
};
let test_span = expr.span.until(then.span);
- span_lint_and_then(cx, MANUAL_STRIP, strippings[0], &format!("stripping a {} manually", kind_word), |diag| {
- diag.span_note(test_span, &format!("the {} was tested here", kind_word));
+ span_lint_and_then(cx, MANUAL_STRIP, strippings[0], &format!("stripping a {kind_word} manually"), |diag| {
+ diag.span_note(test_span, &format!("the {kind_word} was tested here"));
multispan_sugg(
diag,
- &format!("try using the `strip_{}` method", kind_word),
+ &format!("try using the `strip_{kind_word}` method"),
vec![(test_span,
- format!("if let Some(<stripped>) = {}.strip_{}({}) ",
+ format!("if let Some(<stripped>) = {}.strip_{kind_word}({}) ",
snippet(cx, target_arg.span, ".."),
- kind_word,
snippet(cx, pattern.span, "..")))]
.into_iter().chain(strippings.into_iter().map(|span| (span, "<stripped>".into()))),
);