summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/string_from_utf8_as_bytes.stderr
blob: bf5e5d33e8f9ab287f124f7ecb083c92dc327eb0 (plain)
1
2
3
4
5
6
7
8
9
10
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