]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/string_from_utf8_as_bytes.stderr
Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into sync_cg_clif-2021-05-27
[rust.git] / src / tools / clippy / tests / ui / string_from_utf8_as_bytes.stderr
1 error: calling a slice of `as_bytes()` with `from_utf8` should be not necessary
2   --> $DIR/string_from_utf8_as_bytes.rs:5:13
3    |
4 LL |     let _ = std::str::from_utf8(&"Hello World!".as_bytes()[6..11]);
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Some(&"Hello World!"[6..11])`
6    |
7    = note: `-D clippy::string-from-utf8-as-bytes` implied by `-D warnings`
8
9 error: aborting due to previous error
10