From https://github.com/rust-lang/rust/pull/52805#discussion_r205945647. `String::new()` is faster than `""::to_string()` [Benchmark](https://github.com/phansch/bench_string_new): ```rust #[bench] fn bench_string_new(b: &mut Bencher) { b.iter(|| String::new()); } #[bench] fn bench_to_string(b: &mut Bencher) { b.iter(|| "".to_string()); } ``` ``` running 2 tests test tests::bench_string_new ... bench: 0 ns/iter (+/- 0) test tests::bench_to_string ... bench: 8 ns/iter (+/- 0) ``` <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"Guilherme-Vasconcelos"}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->
From rust-lang/rust#52805 (comment).
String::new()is faster than""::to_string()Benchmark: