News for hackers. Stuff that matters.
Re:Rust 1.17 by Rusky on Thursday April 27, 2017 @01:54PM (#14213432)
Rust's + implementation consumes the String on the left, so the default behavior doesn't do any allocation unless the string needs more capacity. This makes it impossible to "get it wrong" in the way you seem to be suspecting.

The part beginners tend to get wrong is trying to add a &str to a &str, which just doesn't have a + implementation to begin with, so they get lost.

There are no comments on this comment yet.