Closed
Description
Hi,
I've opened this issue for clippy
: rust-lang/rust-clippy#8570 wherein a collect::<Vec<String>>().join("")
operation on an Iter<String>
can be expressed as collect::<String>()
which is more performant.
I wanted to put this here as well as I think this may be something that can also be optimized by the compiler (by replacing the former with the latter) since the output should always be equivalent and the latter option is more performant.
See cases of this happening in the wild here (GitHub CS Beta) or here (Sourcegraph)
I'm learning Rust so please let me know if I'm missing something, thank you!