mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 02:23:19 +00:00
76 lines
2.3 KiB
Text
76 lines
2.3 KiB
Text
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:20:9
|
|
|
|
|
20 | 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:20:13
|
|
|
|
|
20 | 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:24:13
|
|
|
|
|
24 | let z = y + "...";
|
|
| ^^^^^^^^^
|
|
|
|
error: you assigned the result of adding something to this string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:34:9
|
|
|
|
|
34 | x = x + ".";
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::string-add-assign` implied by `-D warnings`
|
|
|
|
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:34:9
|
|
|
|
|
34 | 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:48:9
|
|
|
|
|
48 | x = x + ".";
|
|
| ^^^^^^^^^^^
|
|
|
|
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:48:9
|
|
|
|
|
48 | x = x + ".";
|
|
| ^^^^^^^^^^^ help: replace it with: `x += "."`
|
|
|
|
error: you added something to a string. Consider using `String::push_str()` instead
|
|
--> $DIR/strings.rs:52:13
|
|
|
|
|
52 | let z = y + "...";
|
|
| ^^^^^^^^^
|
|
|
|
error: calling `as_bytes()` on a string literal
|
|
--> $DIR/strings.rs:60:14
|
|
|
|
|
60 | 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:65:18
|
|
|
|
|
65 | let strify = stringify!(foobar).as_bytes();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using a byte string literal instead: `bstringify!(foobar)`
|
|
|
|
error: manual implementation of an assign operation
|
|
--> $DIR/strings.rs:75:7
|
|
|
|
|
75 | ; x = x + 1;
|
|
| ^^^^^^^^^ help: replace it with: `x += 1`
|
|
|
|
error: aborting due to 11 previous errors
|
|
|