2020-10-07 22:19:56 -05:00
|
|
|
error: calling a slice of `as_bytes()` with `from_utf8` should be not necessary
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/string_from_utf8_as_bytes.rs:4:13
|
2020-10-07 22:19:56 -05:00
|
|
|
|
|
|
|
|
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`
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|