|
1 | 1 | error: using long and hard to read `.bytes().count()`
|
2 |
| - --> $DIR/bytes_count_to_len.rs:7:5 |
| 2 | + --> $DIR/bytes_count_to_len.rs:8:13 |
3 | 3 | |
|
4 |
| -LL | "hello".bytes().count(); |
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 4 | +LL | let _ = String::from("foo").bytes().count(); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `String::from("foo").len()` |
6 | 6 | |
|
7 | 7 | = note: `-D clippy::bytes-count-to-len` implied by `-D warnings`
|
8 |
| - = note: `.len()` achieves same functionality |
9 | 8 |
|
10 | 9 | error: using long and hard to read `.bytes().count()`
|
11 |
| - --> $DIR/bytes_count_to_len.rs:10:5 |
| 10 | + --> $DIR/bytes_count_to_len.rs:11:13 |
12 | 11 | |
|
13 |
| -LL | s1.bytes().count(); |
14 |
| - | ^^^^^^^^^^^^^^^^^^ |
| 12 | +LL | let _ = s1.bytes().count(); |
| 13 | + | ^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `s1.len()` |
| 14 | + |
| 15 | +error: using long and hard to read `.bytes().count()` |
| 16 | + --> $DIR/bytes_count_to_len.rs:14:13 |
| 17 | + | |
| 18 | +LL | let _ = "foo".bytes().count(); |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `"foo".len()` |
| 20 | + |
| 21 | +error: using long and hard to read `.bytes().count()` |
| 22 | + --> $DIR/bytes_count_to_len.rs:17:13 |
15 | 23 | |
|
16 |
| - = note: `.len()` achieves same functionality |
| 24 | +LL | let _ = s2.bytes().count(); |
| 25 | + | ^^^^^^^^^^^^^^^^^^ help: consider calling `.len` instead:: `s2.len()` |
17 | 26 |
|
18 |
| -error: aborting due to 2 previous errors |
| 27 | +error: aborting due to 4 previous errors |
19 | 28 |
|
0 commit comments