Skip to content

Commit

Permalink
delete :
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoto7250 committed Apr 16, 2022
1 parent 3f0ce06 commit 72d24f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/bytes_count_to_len.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<'tcx> LateLintPass<'tcx> for BytesCountToLen {
BYTES_COUNT_TO_LEN,
expr.span,
"using long and hard to read `.bytes().count()`",
"consider calling `.len` instead:",
"consider calling `.len` instead",
format!("{}.len()", snippet_with_applicability(cx, str_expr.span, "..", &mut applicability)),
applicability
);
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/bytes_count_to_len.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ error: using long and hard to read `.bytes().count()`
--> $DIR/bytes_count_to_len.rs:8:13
|
LL | let _ = String::from("foo").bytes().count();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `String::from("foo").len()`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead: `String::from("foo").len()`
|
= note: `-D clippy::bytes-count-to-len` implied by `-D warnings`

error: using long and hard to read `.bytes().count()`
--> $DIR/bytes_count_to_len.rs:11:13
|
LL | let _ = s1.bytes().count();
| ^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `s1.len()`
| ^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead: `s1.len()`

error: using long and hard to read `.bytes().count()`
--> $DIR/bytes_count_to_len.rs:14:13
|
LL | let _ = "foo".bytes().count();
| ^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `"foo".len()`
| ^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead: `"foo".len()`

error: using long and hard to read `.bytes().count()`
--> $DIR/bytes_count_to_len.rs:17:13
|
LL | let _ = s2.bytes().count();
| ^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `s2.len()`
| ^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead: `s2.len()`

error: aborting due to 4 previous errors

0 comments on commit 72d24f7

Please sign in to comment.