summaryrefslogtreecommitdiff
path: root/src/meter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/meter.rs')
-rw-r--r--src/meter.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/meter.rs b/src/meter.rs
index 1b6003db..32650e4d 100644
--- a/src/meter.rs
+++ b/src/meter.rs
@@ -75,9 +75,7 @@ impl<'a> Sampler<'a> {
impl<'a> Drop for Sampler<'a> {
fn drop(&mut self) {
- // Work around borrowck
- let duration = self.alive_duration();
- self.meter.add_sample(duration);
+ self.meter.add_sample(self.alive_duration());
}
}
@@ -88,7 +86,7 @@ impl Meter {
}
/// Get a sampler
- pub fn sampler(&mut self) -> Sampler {
+ pub fn sampler(&mut self) -> Sampler<'_> {
Sampler::new(self)
}