diff options
Diffstat (limited to 'src/meter.rs')
-rw-r--r-- | src/meter.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/meter.rs b/src/meter.rs index b4bab5ff..2dc2ed21 100644 --- a/src/meter.rs +++ b/src/meter.rs @@ -36,6 +36,7 @@ use std::time::{Instant, Duration}; const NUM_SAMPLES: usize = 10; /// The meter +#[derive(Default)] pub struct Meter { /// Track last 60 timestamps times: [f64; NUM_SAMPLES], @@ -83,11 +84,7 @@ impl<'a> Drop for Sampler<'a> { impl Meter { /// Create a meter pub fn new() -> Meter { - Meter { - times: [0.0; NUM_SAMPLES], - avg: 0.0, - index: 0, - } + Default::default() } /// Get a sampler |