#[macro_use] extern crate bencher; use bencher::Bencher; use std::borrow::Cow; fn bench_cowstring(b: &mut Bencher) { b.iter(|| { let fizz = Into::>::into("Fizz").into_owned(); let buzz = Into::>::into("Buzz"); Into::>::into(fizz + &*buzz) }); } fn bench_cowstring_ms2ger(b: &mut Bencher) { b.iter( || { let mut fizz = Into::>::into("Fizz").into_owned(); let buzz = Into::>::into("Buzz"); fizz.push_str(&*buzz); Into::>::into(fizz); } ); } benchmark_group!(benches, bench_cowstring, bench_cowstring_ms2ger); benchmark_main!(benches);