mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
410456da51
new lint: `format_collect` A perf lint that looks for `format!`ing inside of `map`, then collecting it into a `String`. Did a quick benchmark locally and it's a bit more than 2x faster with fold. `write!` is still not optimal (presumably because the fmt stuff goes through dynamic dispatch), but it's still a lot better than creating a new string on every element. I thought about making a machine applicable suggestion, but there's a lot of suggestions that need to be made here, so I decided to just add help messages. changelog: new lint: `format_collect` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |