about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAkshay <nerdy@peppe.rs>2022-02-08 16:51:02 +0530
committerflip1995 <philipp.krones@embecosm.com>2022-04-05 10:53:10 +0100
commit1582e7bf88175f7362f5bd12ad5835dcdfb58473 (patch)
treede2a41b4033ed3355e7a2857c98c3a6c3a157268
parent8ec7ba44bd558cd7e6d6209f3feab9e0c6ee742f (diff)
downloadrust-1582e7bf88175f7362f5bd12ad5835dcdfb58473.tar.gz
rust-1582e7bf88175f7362f5bd12ad5835dcdfb58473.zip
fix mispelling in diagnostic message of bytes_nth
-rw-r--r--clippy_lints/src/methods/bytes_nth.rs2
-rw-r--r--tests/ui/bytes_nth.stderr6
2 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/methods/bytes_nth.rs b/clippy_lints/src/methods/bytes_nth.rs
index 76eaedea8a0..44857d61fef 100644
--- a/clippy_lints/src/methods/bytes_nth.rs
+++ b/clippy_lints/src/methods/bytes_nth.rs
@@ -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({})",
diff --git a/tests/ui/bytes_nth.stderr b/tests/ui/bytes_nth.stderr
index 536decf5e7f..5641d798853 100644
--- a/tests/ui/bytes_nth.stderr
+++ b/tests/ui/bytes_nth.stderr
@@ -1,4 +1,4 @@
-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);
@@ -6,13 +6,13 @@ LL |     s.bytes().nth(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);