Skip to content

Commit c73cf9f

Browse files
committed
Auto merge of #5893 - matthiaskrgr:lint_msg, r=yaahc
fix remaining lint messages r? @yaahc changelog: make remaining lint messages adhere to rustc dev guide lint message convention.
2 parents 2f4de2f + be3e695 commit c73cf9f

26 files changed

+122
-122
lines changed

clippy_lints/src/duration_subsec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'tcx> LateLintPass<'tcx> for DurationSubsec {
5656
cx,
5757
DURATION_SUBSEC,
5858
expr.span,
59-
&format!("Calling `{}()` is more concise than this calculation", suggested_fn),
59+
&format!("calling `{}()` is more concise than this calculation", suggested_fn),
6060
"try",
6161
format!(
6262
"{}.{}()",

clippy_lints/src/enum_clike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'tcx> LateLintPass<'tcx> for UnportableVariant {
7272
cx,
7373
ENUM_CLIKE_UNPORTABLE_VARIANT,
7474
var.span,
75-
"Clike enum variant discriminant is not portable to 32-bit targets",
75+
"C-like enum variant discriminant is not portable to 32-bit targets",
7676
);
7777
};
7878
}

clippy_lints/src/enum_variants.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ fn check_variant(
183183
&& name.chars().nth(item_name_chars).map_or(false, |c| !c.is_lowercase())
184184
&& name.chars().nth(item_name_chars + 1).map_or(false, |c| !c.is_numeric())
185185
{
186-
span_lint(cx, lint, var.span, "Variant name starts with the enum's name");
186+
span_lint(cx, lint, var.span, "variant name starts with the enum's name");
187187
}
188188
if partial_rmatch(item_name, &name) == item_name_chars {
189-
span_lint(cx, lint, var.span, "Variant name ends with the enum's name");
189+
span_lint(cx, lint, var.span, "variant name ends with the enum's name");
190190
}
191191
}
192192
let first = &def.variants[0].ident.name.as_str();
@@ -227,7 +227,7 @@ fn check_variant(
227227
cx,
228228
lint,
229229
span,
230-
&format!("All variants have the same {}fix: `{}`", what, value),
230+
&format!("all variants have the same {}fix: `{}`", what, value),
231231
None,
232232
&format!(
233233
"remove the {}fixes and use full paths to \

clippy_lints/src/if_let_some_result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl<'tcx> LateLintPass<'tcx> for OkIfLet {
6161
cx,
6262
IF_LET_SOME_RESULT,
6363
expr.span.with_hi(op.span.hi()),
64-
"Matching on `Some` with `ok()` is redundant",
65-
&format!("Consider matching on `Ok({})` and removing the call to `ok` instead", some_expr_string),
64+
"matching on `Some` with `ok()` is redundant",
65+
&format!("consider matching on `Ok({})` and removing the call to `ok` instead", some_expr_string),
6666
sugg,
6767
applicability,
6868
);

clippy_lints/src/if_not_else.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl EarlyLintPass for IfNotElse {
6060
cx,
6161
IF_NOT_ELSE,
6262
item.span,
63-
"Unnecessary boolean `not` operation",
63+
"unnecessary boolean `not` operation",
6464
None,
6565
"remove the `!` and swap the blocks of the `if`/`else`",
6666
);
@@ -70,7 +70,7 @@ impl EarlyLintPass for IfNotElse {
7070
cx,
7171
IF_NOT_ELSE,
7272
item.span,
73-
"Unnecessary `!=` operation",
73+
"unnecessary `!=` operation",
7474
None,
7575
"change to `==` and swap the blocks of the `if`/`else`",
7676
);

clippy_lints/src/implicit_saturating_sub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ fn print_lint_and_sugg(cx: &LateContext<'_>, var_name: &str, expr: &Expr<'_>) {
158158
cx,
159159
IMPLICIT_SATURATING_SUB,
160160
expr.span,
161-
"Implicitly performing saturating subtraction",
161+
"implicitly performing saturating subtraction",
162162
"try",
163-
format!("{} = {}.saturating_sub({});", var_name, var_name, 1.to_string()),
163+
format!("{} = {}.saturating_sub({});", var_name, var_name, '1'),
164164
Applicability::MachineApplicable,
165165
);
166166
}

clippy_lints/src/inherent_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
8181
cx,
8282
MULTIPLE_INHERENT_IMPL,
8383
*additional_span,
84-
"Multiple implementations of this structure",
84+
"multiple implementations of this structure",
8585
|diag| {
86-
diag.span_note(*initial_span, "First implementation here");
86+
diag.span_note(*initial_span, "first implementation here");
8787
},
8888
)
8989
})

clippy_lints/src/int_plus_one.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl IntPlusOne {
152152
cx,
153153
INT_PLUS_ONE,
154154
block.span,
155-
"Unnecessary `>= y + 1` or `x - 1 >=`",
155+
"unnecessary `>= y + 1` or `x - 1 >=`",
156156
"change it to",
157157
recommendation,
158158
Applicability::MachineApplicable, // snippet
@@ -163,8 +163,8 @@ impl IntPlusOne {
163163
impl EarlyLintPass for IntPlusOne {
164164
fn check_expr(&mut self, cx: &EarlyContext<'_>, item: &Expr) {
165165
if let ExprKind::Binary(ref kind, ref lhs, ref rhs) = item.kind {
166-
if let Some(ref rec) = Self::check_binop(cx, kind.node, lhs, rhs) {
167-
Self::emit_warning(cx, item, rec.clone());
166+
if let Some(rec) = Self::check_binop(cx, kind.node, lhs, rhs) {
167+
Self::emit_warning(cx, item, rec);
168168
}
169169
}
170170
}

clippy_lints/src/map_clone.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ fn lint_needless_cloning(cx: &LateContext<'_>, root: Span, receiver: Span) {
111111
cx,
112112
MAP_CLONE,
113113
root.trim_start(receiver).unwrap(),
114-
"You are needlessly cloning iterator elements",
115-
"Remove the `map` call",
114+
"you are needlessly cloning iterator elements",
115+
"remove the `map` call",
116116
String::new(),
117117
Applicability::MachineApplicable,
118118
)
@@ -125,8 +125,8 @@ fn lint(cx: &LateContext<'_>, replace: Span, root: Span, copied: bool) {
125125
cx,
126126
MAP_CLONE,
127127
replace,
128-
"You are using an explicit closure for copying elements",
129-
"Consider calling the dedicated `copied` method",
128+
"you are using an explicit closure for copying elements",
129+
"consider calling the dedicated `copied` method",
130130
format!(
131131
"{}.copied()",
132132
snippet_with_applicability(cx, root, "..", &mut applicability)
@@ -138,8 +138,8 @@ fn lint(cx: &LateContext<'_>, replace: Span, root: Span, copied: bool) {
138138
cx,
139139
MAP_CLONE,
140140
replace,
141-
"You are using an explicit closure for cloning elements",
142-
"Consider calling the dedicated `cloned` method",
141+
"you are using an explicit closure for cloning elements",
142+
"consider calling the dedicated `cloned` method",
143143
format!(
144144
"{}.cloned()",
145145
snippet_with_applicability(cx, root, "..", &mut applicability)

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,7 +2280,7 @@ fn lint_iter_next<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, iter_
22802280
cx,
22812281
ITER_NEXT_SLICE,
22822282
expr.span,
2283-
"Using `.iter().next()` on a Slice without end index.",
2283+
"using `.iter().next()` on a Slice without end index",
22842284
"try calling",
22852285
format!("{}.get({})", snippet_with_applicability(cx, caller_var.span, "..", &mut applicability), start_idx),
22862286
applicability,
@@ -2299,7 +2299,7 @@ fn lint_iter_next<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, iter_
22992299
cx,
23002300
ITER_NEXT_SLICE,
23012301
expr.span,
2302-
"Using `.iter().next()` on an array",
2302+
"using `.iter().next()` on an array",
23032303
"try calling",
23042304
format!(
23052305
"{}.get(0)",

0 commit comments

Comments
 (0)