rust-clippy/tests/ui/format_push_string.stderr

54 lines
1.6 KiB
Text

error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:5:5
|
LL | string += &format!("{:?}", 1234);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `write!` to avoid the extra allocation
= note: `-D clippy::format-push-string` implied by `-D warnings`
error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:6:5
|
LL | string.push_str(&format!("{:?}", 5678));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:13:13
|
LL | / hex += &(if upper {
LL | | format!("{byte:02X}")
LL | | } else {
LL | | format!("{byte:02x}")
LL | | });
| |______________^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:25:9
|
LL | / s += &(if let Some(_a) = Some(1234) {
LL | | format!("{}", 1234)
LL | | } else {
LL | | format!("{}", 1234)
LL | | });
| |__________^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:31:9
|
LL | / s += &(match Some(1234) {
LL | | Some(_) => format!("{}", 1234),
LL | | None => format!("{}", 1234),
LL | | });
| |__________^
|
= help: consider using `write!` to avoid the extra allocation
error: aborting due to 5 previous errors