mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
76 lines
2 KiB
Text
76 lines
2 KiB
Text
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:10:13
|
|
|
|
|
10 | x = x + ".";
|
|
| ^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/strings.rs:4:8
|
|
|
|
|
4 | #[deny(string_add)]
|
|
| ^^^^^^^^^^
|
|
|
|
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:14:13
|
|
|
|
|
14 | let z = y + "...";
|
|
| ^^^^^^^^^
|
|
|
|
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:24:9
|
|
|
|
|
24 | x = x + ".";
|
|
| ^^^^^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/strings.rs:19:8
|
|
|
|
|
19 | #[deny(string_add_assign)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:38:9
|
|
|
|
|
38 | x = x + ".";
|
|
| ^^^^^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/strings.rs:33:20
|
|
|
|
|
33 | #[deny(string_add, string_add_assign)]
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:42:13
|
|
|
|
|
42 | let z = y + "...";
|
|
| ^^^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/strings.rs:33:8
|
|
|
|
|
33 | #[deny(string_add, string_add_assign)]
|
|
| ^^^^^^^^^^
|
|
|
|
error: calling `as_bytes()` on a string literal
|
|
--> $DIR/strings.rs:50:14
|
|
|
|
|
50 | let bs = "hello there".as_bytes();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead `b"hello there"`
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/strings.rs:48:8
|
|
|
|
|
48 | #[deny(string_lit_as_bytes)]
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:68:7
|
|
|
|
|
68 | ; x = x + 1;
|
|
| ^^^^^^^^^ help: replace it with `x += 1`
|
|
|
|
|
= note: #[warn(assign_op_pattern)] on by default
|
|
|
|
error: aborting due to 6 previous errors
|
|
|