Skip to content

Commit 938b9fd

Browse files
committed
Auto merge of #8403 - nerdypepper:fix/diagnostic-message-mispelling, r=flip1995,Manishearth
fix misspelling in diagnostic message of `bytes_nth` *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: fix misspelling in diagnostic message in ``[`bytes_nth`]``
2 parents 511752f + 1582e7b commit 938b9fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/methods/bytes_nth.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, recv: &'tcx E
2222
cx,
2323
BYTES_NTH,
2424
expr.span,
25-
&format!("called `.byte().nth()` on a `{}`", caller_type),
25+
&format!("called `.bytes().nth()` on a `{}`", caller_type),
2626
"try",
2727
format!(
2828
"{}.as_bytes().get({})",

tests/ui/bytes_nth.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
error: called `.byte().nth()` on a `String`
1+
error: called `.bytes().nth()` on a `String`
22
--> $DIR/bytes_nth.rs:8:5
33
|
44
LL | s.bytes().nth(3);
55
| ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
66
|
77
= note: `-D clippy::bytes-nth` implied by `-D warnings`
88

9-
error: called `.byte().nth()` on a `String`
9+
error: called `.bytes().nth()` on a `String`
1010
--> $DIR/bytes_nth.rs:9:14
1111
|
1212
LL | let _ = &s.bytes().nth(3);
1313
| ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
1414

15-
error: called `.byte().nth()` on a `str`
15+
error: called `.bytes().nth()` on a `str`
1616
--> $DIR/bytes_nth.rs:10:5
1717
|
1818
LL | s[..].bytes().nth(3);

0 commit comments

Comments
 (0)