From b17897064d60f5356dbd92350a75546d9c70270a Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 12 Nov 2024 21:15:22 -0500 Subject: [PATCH] examples: Use Display impl for Duration --- examples/suggest.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/suggest.rs b/examples/suggest.rs index 6b1403f..469c53e 100644 --- a/examples/suggest.rs +++ b/examples/suggest.rs @@ -30,14 +30,14 @@ fn main() { let now = Instant::now(); let dict = Dictionary::new(EN_US_AFF, EN_US_DIC).unwrap(); - println!("Compiled the dictionary in {}ms", now.elapsed().as_millis()); + println!("Compiled the dictionary in {:?}", now.elapsed()); let mut suggestions = Vec::with_capacity(5); let now = Instant::now(); dict.suggest(&word, &mut suggestions); - let time = now.elapsed().as_micros(); + let time = now.elapsed(); if suggestions.is_empty() { - println!("No suggestions found for \"{word}\" (checked in {time}µs)"); + println!("No suggestions found for \"{word}\" (checked in {time:?})"); } else { let suggestions = suggestions .into_iter() @@ -50,6 +50,6 @@ fn main() { s.push('"'); s }); - println!("Suggestions for \"{word}\": {suggestions} (checked in {time}µs)"); + println!("Suggestions for \"{word}\": {suggestions} (checked in {time:?})"); } }