diff options
Diffstat (limited to 'src/accumulated_time.rs')
-rw-r--r-- | src/accumulated_time.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/accumulated_time.rs b/src/accumulated_time.rs index e633a10..cdf34b2 100644 --- a/src/accumulated_time.rs +++ b/src/accumulated_time.rs @@ -37,7 +37,7 @@ impl<T: Eq + PartialEq + Hash + Copy> AccumulatedTime<T> { /// clock is stopped. pub fn start(&mut self, clock: T) { let mut map = self.accumulated.lock().unwrap(); - let ct = map.entry(clock).or_insert_with(ClockTime::default); + let ct = map.entry(clock).or_default(); assert!(ct.started.is_none()); ct.started = Some(Instant::now()); } @@ -47,7 +47,7 @@ impl<T: Eq + PartialEq + Hash + Copy> AccumulatedTime<T> { /// Its run time is added to the accumulated time for that kind of clock. pub fn stop(&mut self, clock: T) { let mut map = self.accumulated.lock().unwrap(); - if let Some(mut ct) = map.get_mut(&clock) { + if let Some(ct) = map.get_mut(&clock) { assert!(ct.started.is_some()); if let Some(started) = ct.started.take() { ct.nanos += started.elapsed().as_nanos(); |