4 ms·
> Creating new objects in functions and returning them should be avoided if possible. Isn't that how "constructors" in Rust work (i.e. `Foo::new()` calls)? Plu
by azth 12y ago
> Creating new objects in functions and returning them should be avoided if possible.
Isn't that how "constructors" in Rust work (i.e. `Foo::new()` calls)? Plus, with return value optimization, it should be pretty performant.