summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/needless_as_bytes.stderr
blob: 3391238a142bf53eb82354e1f8ec388ed0a77b5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
error: needless call to `as_bytes()`
  --> tests/ui/needless_as_bytes.rs:13:8
   |
LL |     if "some string".as_bytes().is_empty() {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `is_empty()` can be called directly on strings: `"some string".is_empty()`
   |
   = note: `-D clippy::needless-as-bytes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_as_bytes)]`

error: needless call to `as_bytes()`
  --> tests/ui/needless_as_bytes.rs:15:30
   |
LL |         println!("len = {}", "some string".as_bytes().len());
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `"some string".len()`

error: needless call to `as_bytes()`
  --> tests/ui/needless_as_bytes.rs:20:8
   |
LL |     if s.as_bytes().is_empty() {
   |        ^^^^^^^^^^^^^^^^^^^^^^^ help: `is_empty()` can be called directly on strings: `s.is_empty()`

error: needless call to `as_bytes()`
  --> tests/ui/needless_as_bytes.rs:22:30
   |
LL |         println!("len = {}", s.as_bytes().len());
   |                              ^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `s.len()`

error: aborting due to 4 previous errors