Skip to content

Commit 6af297f

Browse files
committed
iter-next-slice: make lint adhere to lint message convention
1 parent 04867e0 commit 6af297f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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)",

tests/ui/iter_next_slice.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
error: Using `.iter().next()` on an array
1+
error: using `.iter().next()` on an array
22
--> $DIR/iter_next_slice.rs:9:5
33
|
44
LL | s.iter().next();
55
| ^^^^^^^^^^^^^^^ help: try calling: `s.get(0)`
66
|
77
= note: `-D clippy::iter-next-slice` implied by `-D warnings`
88

9-
error: Using `.iter().next()` on a Slice without end index.
9+
error: using `.iter().next()` on a Slice without end index
1010
--> $DIR/iter_next_slice.rs:12:5
1111
|
1212
LL | s[2..].iter().next();
1313
| ^^^^^^^^^^^^^^^^^^^^ help: try calling: `s.get(2)`
1414

15-
error: Using `.iter().next()` on a Slice without end index.
15+
error: using `.iter().next()` on a Slice without end index
1616
--> $DIR/iter_next_slice.rs:15:5
1717
|
1818
LL | v[5..].iter().next();
1919
| ^^^^^^^^^^^^^^^^^^^^ help: try calling: `v.get(5)`
2020

21-
error: Using `.iter().next()` on an array
21+
error: using `.iter().next()` on an array
2222
--> $DIR/iter_next_slice.rs:18:5
2323
|
2424
LL | v.iter().next();

0 commit comments

Comments
 (0)