2020-11-23 12:51:04 +00:00
|
|
|
error: calling a slice of `as_bytes()` with `from_utf8` should be not necessary
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/string_from_utf8_as_bytes.rs:4:13
|
2020-11-23 12:51:04 +00: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`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::string_from_utf8_as_bytes)]`
|
2020-11-23 12:51:04 +00:00
|
|
|
|
2023-11-21 17:08:42 +00:00
|
|
|
error: aborting due to 1 previous error
|
2020-11-23 12:51:04 +00:00
|
|
|
|