rust/tests/ui/needless_as_bytes.stderr

30 lines
1.2 KiB
Plaintext
Raw Normal View History

2024-09-21 15:40:50 -05:00
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