1c9f3bef8b
This lint checks for `as_str` on a `String` immediately followed by `as_bytes` or `is_empty` as those methods are available on `String` too. This could possibly also be extended to `&[u8]` in the future.
7 lines
170 B
Rust
7 lines
170 B
Rust
#![warn(clippy::redundant_as_str)]
|
|
|
|
fn main() {
|
|
let _redundant = "Hello, world!".to_owned().as_bytes();
|
|
let _redundant = "Hello, world!".to_owned().is_empty();
|
|
}
|