mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
76 lines
2.6 KiB
Text
76 lines
2.6 KiB
Text
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:8:9
|
|
|
|
|
LL | x = x + ".";
|
|
| ^^^^^^^^^^^ help: replace it with: `x += "."`
|
|
|
|
|
= note: `-D clippy::assign-op-pattern` implied by `-D warnings`
|
|
|
|
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:8:13
|
|
|
|
|
LL | x = x + ".";
|
|
| ^^^^^^^
|
|
|
|
|
= note: `-D clippy::string-add` implied by `-D warnings`
|
|
|
|
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:12:13
|
|
|
|
|
LL | let z = y + "...";
|
|
| ^^^^^^^^^
|
|
|
|
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:22:9
|
|
|
|
|
LL | x = x + ".";
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::string-add-assign` implied by `-D warnings`
|
|
|
|
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:22:9
|
|
|
|
|
LL | x = x + ".";
|
|
| ^^^^^^^^^^^ help: replace it with: `x += "."`
|
|
|
|
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:36:9
|
|
|
|
|
LL | x = x + ".";
|
|
| ^^^^^^^^^^^
|
|
|
|
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:36:9
|
|
|
|
|
LL | x = x + ".";
|
|
| ^^^^^^^^^^^ help: replace it with: `x += "."`
|
|
|
|
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:40:13
|
|
|
|
|
LL | let z = y + "...";
|
|
| ^^^^^^^^^
|
|
|
|
error: calling `as_bytes()` on a string literal
|
|
--> $DIR/strings.rs:48: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/strings.rs:50: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/strings.rs:57:22
|
|
|
|
|
LL | let includestr = include_str!("entry.rs").as_bytes();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `include_bytes!(..)` instead: `include_bytes!("entry.rs")`
|
|
|
|
error: aborting due to 11 previous errors
|
|
|