diff --git a/abstutil/src/time.rs b/abstutil/src/time.rs index 66414f9ee5..2501ca5b45 100644 --- a/abstutil/src/time.rs +++ b/abstutil/src/time.rs @@ -79,13 +79,13 @@ struct TimerSpan { } impl Timer { - pub fn new(name: String) -> Timer { + pub fn new(name: &str) -> Timer { let mut t = Timer { results: Vec::new(), stack: Vec::new(), - outermost_name: name.clone(), + outermost_name: name.to_string(), }; - t.start(&name); + t.start(name); t } diff --git a/convert_osm/src/main.rs b/convert_osm/src/main.rs index 5af865d155..f25dd99689 100644 --- a/convert_osm/src/main.rs +++ b/convert_osm/src/main.rs @@ -7,7 +7,7 @@ use structopt::StructOpt; fn main() { let flags = Flags::from_args(); - let mut timer = abstutil::Timer::new(format!("generate {}", flags.output)); + let mut timer = abstutil::Timer::new(&format!("generate {}", flags.output)); let map = convert(&flags, &mut timer); println!("writing to {}", flags.output); timer.start("saving map"); diff --git a/precompute/src/main.rs b/precompute/src/main.rs index a02792dd48..b4ae2df183 100644 --- a/precompute/src/main.rs +++ b/precompute/src/main.rs @@ -15,7 +15,7 @@ fn main() { log::set_logger(&LOG_ADAPTER).unwrap(); let flags = SimFlags::from_args(); - let mut timer = Timer::new(format!( + let mut timer = Timer::new(&format!( "precompute {} with {}", flags.load, flags.edits_name ));