mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
bc27d1492d
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
11 lines
437 B
Plaintext
11 lines
437 B
Plaintext
error: calling a slice of `as_bytes()` with `from_utf8` should be not necessary
|
|
--> $DIR/string_from_utf8_as_bytes.rs:5: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`
|
|
|
|
error: aborting due to previous error
|
|
|