3 #![allow(dead_code, unused_variables)]
4 #![warn(clippy::string_lit_as_bytes)]
6 fn str_lit_as_bytes() {
7 let bs = "hello there".as_bytes();
9 let bs = r###"raw string with three ### in it and some " ""###.as_bytes();
11 // no warning, because this cannot be written as a byte string literal:
12 let ubs = "☃".as_bytes();
14 let strify = stringify!(foobar).as_bytes();
16 let includestr = include_str!("entry.rs").as_bytes();