]> git.lizzy.rs Git - rust.git/blob - tests/ui/string_lit_as_bytes.fixed
Auto merge of #3879 - phansch:rustfix_string_lit_as_bytes, r=flip1995
[rust.git] / tests / ui / string_lit_as_bytes.fixed
1 // run-rustfix
2
3 #![allow(dead_code, unused_variables)]
4 #![warn(clippy::string_lit_as_bytes)]
5
6 fn str_lit_as_bytes() {
7     let bs = b"hello there";
8
9     let bs = br###"raw string with three ### in it and some " ""###;
10
11     // no warning, because this cannot be written as a byte string literal:
12     let ubs = "☃".as_bytes();
13
14     let strify = stringify!(foobar).as_bytes();
15
16     let includestr = include_bytes!("entry.rs");
17 }
18
19 fn main() {}