Get rid of double double colons

This commit is contained in:
Oliver Schneider 2017-07-24 16:28:41 +02:00
parent 00c5105463
commit 72b2e9539f
12 changed files with 54 additions and 54 deletions

View file

@ -96,7 +96,7 @@ fn check_closure(cx: &LateContext, expr: &Expr) {
expr.span,
"redundant closure found",
|db| if let Some(snippet) = snippet_opt(cx, caller.span) {
db.span_suggestion(expr.span, "remove closure as shown:", snippet);
db.span_suggestion(expr.span, "remove closure as shown", snippet);
});
}
}

View file

@ -173,7 +173,7 @@ fn check_len_zero(cx: &LateContext, span: Span, name: Name, args: &[Expr], lit:
LEN_ZERO,
span,
"length comparison to zero",
"using `is_empty` is more concise:",
"using `is_empty` is more concise",
format!("{}{}.is_empty()", op, snippet(cx, args[0].span, "_")));
}
}

View file

@ -1233,7 +1233,7 @@ fn lint_single_char_pattern(cx: &LateContext, expr: &hir::Expr, arg: &hir::Expr)
SINGLE_CHAR_PATTERN,
arg.span,
"single-character string constant used as pattern",
|db| { db.span_suggestion(expr.span, "try using a char instead:", hint); });
|db| { db.span_suggestion(expr.span, "try using a char instead", hint); });
}
}
}

View file

@ -366,12 +366,12 @@ impl MiscEarly {
|db| {
db.span_suggestion(
lit.span,
"if you mean to use a decimal constant, remove the `0` to remove confusion:",
"if you mean to use a decimal constant, remove the `0` to remove confusion",
src.trim_left_matches('0').to_string(),
);
db.span_suggestion(
lit.span,
"if you mean to use an octal constant, use `0o`:",
"if you mean to use an octal constant, use `0o`",
format!("0o{}", src.trim_left_matches('0')),
);
});

View file

@ -126,7 +126,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoolComparison {
BOOL_COMPARISON,
e.span,
"equality checks against true are unnecessary",
"try simplifying it as shown:",
"try simplifying it as shown",
hint);
},
(Other, Bool(true)) => {
@ -135,7 +135,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoolComparison {
BOOL_COMPARISON,
e.span,
"equality checks against true are unnecessary",
"try simplifying it as shown:",
"try simplifying it as shown",
hint);
},
(Bool(false), Other) => {
@ -144,7 +144,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoolComparison {
BOOL_COMPARISON,
e.span,
"equality checks against false can be replaced by a negation",
"try simplifying it as shown:",
"try simplifying it as shown",
(!hint).to_string());
},
(Other, Bool(false)) => {
@ -153,7 +153,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoolComparison {
BOOL_COMPARISON,
e.span,
"equality checks against false can be replaced by a negation",
"try simplifying it as shown:",
"try simplifying it as shown",
(!hint).to_string());
},
_ => (),

View file

@ -97,7 +97,7 @@ impl ReturnPass {
ret_span,
"unneeded return statement",
|db| if let Some(snippet) = snippet_opt(cx, inner_span) {
db.span_suggestion(ret_span, "remove `return` as shown:", snippet);
db.span_suggestion(ret_span, "remove `return` as shown", snippet);
});
}