RS.CLIPPY.STRING_ADD_ASSIGN
Using `x = x + ..` where x is a `String` instead of `push_str()`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: string_add_assign. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for string appends of the form x = x + y (without
let!).
Why is this bad?
It's not really bad, but some people think that the
.push_str(_) method is more readable.
Example
let mut x = "Hello".to_owned();
x = x + ", World";
// More readable
x += ", World";
x.push_str(", World");