rust-clippy/tests/ui/format_push_string.stderr

59 lines
1.8 KiB
Text
Raw Normal View History

error: `format!(..)` appended to existing `String`
2024-02-17 12:16:29 +00:00
--> tests/ui/format_push_string.rs:5:5
|
LL | string += &format!("{:?}", 1234);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `write!` to avoid the extra allocation
2022-09-22 16:04:22 +00:00
= note: `-D clippy::format-push-string` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::format_push_string)]`
error: `format!(..)` appended to existing `String`
2024-02-17 12:16:29 +00:00
--> tests/ui/format_push_string.rs:7:5
|
LL | string.push_str(&format!("{:?}", 5678));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
2024-02-17 12:16:29 +00:00
--> tests/ui/format_push_string.rs:15:13
|
LL | / hex += &(if upper {
LL | |
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`
2024-02-17 12:16:29 +00:00
--> tests/ui/format_push_string.rs:28:9
|
LL | / s += &(if let Some(_a) = Some(1234) {
LL | |
LL | | format!("{}", 1234)
LL | | } else {
LL | | format!("{}", 1234)
LL | | });
| |__________^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
2024-02-17 12:16:29 +00:00
--> tests/ui/format_push_string.rs:35:9
|
LL | / s += &(match Some(1234) {
LL | |
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