mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
c2c73189c8
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
11 lines
526 B
Text
11 lines
526 B
Text
error: calling a slice of `as_bytes()` with `from_utf8` should be not necessary
|
|
--> $DIR/string_from_utf8_as_bytes.rs:4:13
|
|
|
|
|
LL | let _ = std::str::from_utf8(&"Hello World!".as_bytes()[6..11]);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(&"Hello World!"[6..11])`
|
|
|
|
|
= note: `-D clippy::string-from-utf8-as-bytes` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::string_from_utf8_as_bytes)]`
|
|
|
|
error: aborting due to 1 previous error
|
|
|