Skip to content

Commit 40416c0

Browse files
committed
naive_bytecount: make lint adhere to lint message convention
1 parent fd379a8 commit 40416c0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

clippy_lints/src/bytecount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
8282
cx,
8383
NAIVE_BYTECOUNT,
8484
expr.span,
85-
"You appear to be counting bytes the naive way",
86-
"Consider using the bytecount crate",
85+
"you appear to be counting bytes the naive way",
86+
"consider using the bytecount crate",
8787
format!("bytecount::count({}, {})",
8888
snippet_with_applicability(cx, haystack.span, "..", &mut applicability),
8989
snippet_with_applicability(cx, needle.span, "..", &mut applicability)),

tests/ui/bytecount.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
error: You appear to be counting bytes the naive way
1+
error: you appear to be counting bytes the naive way
22
--> $DIR/bytecount.rs:5:13
33
|
44
LL | let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, 0)`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the bytecount crate: `bytecount::count(x, 0)`
66
|
77
note: the lint level is defined here
88
--> $DIR/bytecount.rs:1:8
99
|
1010
LL | #[deny(clippy::naive_bytecount)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^
1212

13-
error: You appear to be counting bytes the naive way
13+
error: you appear to be counting bytes the naive way
1414
--> $DIR/bytecount.rs:7:13
1515
|
1616
LL | let _ = (&x[..]).iter().filter(|&a| *a == 0).count(); // naive byte count
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count((&x[..]), 0)`
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the bytecount crate: `bytecount::count((&x[..]), 0)`
1818

19-
error: You appear to be counting bytes the naive way
19+
error: you appear to be counting bytes the naive way
2020
--> $DIR/bytecount.rs:19:13
2121
|
2222
LL | let _ = x.iter().filter(|a| b + 1 == **a).count(); // naive byte count
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, b + 1)`
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the bytecount crate: `bytecount::count(x, b + 1)`
2424

2525
error: aborting due to 3 previous errors
2626

0 commit comments

Comments
 (0)