mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
23 lines
1.0 KiB
Plaintext
23 lines
1.0 KiB
Plaintext
|
error: calling `as_bytes()` on a string literal
|
||
|
--> $DIR/string_lit_as_bytes.rs:7:14
|
||
|
|
|
||
|
LL | let bs = "hello there".as_bytes();
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `b"hello there"`
|
||
|
|
|
||
|
= note: `-D clippy::string-lit-as-bytes` implied by `-D warnings`
|
||
|
|
||
|
error: calling `as_bytes()` on a string literal
|
||
|
--> $DIR/string_lit_as_bytes.rs:9:14
|
||
|
|
|
||
|
LL | let bs = r###"raw string with three ### in it and some " ""###.as_bytes();
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `br###"raw string with three ### in it and some " ""###`
|
||
|
|
||
|
error: calling `as_bytes()` on `include_str!(..)`
|
||
|
--> $DIR/string_lit_as_bytes.rs:16:22
|
||
|
|
|
||
|
LL | let includestr = include_str!("entry.rs").as_bytes();
|
||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `include_bytes!(..)` instead: `include_bytes!("entry.rs")`
|
||
|
|
||
|
error: aborting due to 3 previous errors
|
||
|
|