Skip to content

Commit

Permalink
Auto merge of #8403 - nerdypepper:fix/diagnostic-message-mispelling, …
Browse files Browse the repository at this point in the history
…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`]``
  • Loading branch information
bors committed Apr 5, 2022
2 parents 511752f + 1582e7b commit 938b9fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/bytes_nth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, recv: &'tcx E
cx,
BYTES_NTH,
expr.span,
&format!("called `.byte().nth()` on a `{}`", caller_type),
&format!("called `.bytes().nth()` on a `{}`", caller_type),
"try",
format!(
"{}.as_bytes().get({})",
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/bytes_nth.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: called `.byte().nth()` on a `String`
error: called `.bytes().nth()` on a `String`
--> $DIR/bytes_nth.rs:8:5
|
LL | s.bytes().nth(3);
| ^^^^^^^^^^^^^^^^ help: try: `s.as_bytes().get(3)`
|
= note: `-D clippy::bytes-nth` implied by `-D warnings`

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

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

0 comments on commit 938b9fd

Please sign in to comment.