From 6c398ae6f40526994918a271e8193a72768a1ff7 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Fri, 24 Feb 2017 15:19:48 -0800 Subject: [PATCH] Remove dependencies from oldtime::Duration on rest of time crate --- src/oldtime.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/oldtime.rs b/src/oldtime.rs index 33050ae..2bdc2f6 100644 --- a/src/oldtime.rs +++ b/src/oldtime.rs @@ -12,7 +12,7 @@ use std::{fmt, i64}; use std::error::Error; -use std::ops::{Add, Sub, Mul, Div, Neg, FnOnce}; +use std::ops::{Add, Sub, Mul, Div, Neg}; use std::time::Duration as StdDuration; /// The number of nanoseconds in a microsecond. @@ -131,14 +131,6 @@ impl Duration { Duration { secs: secs, nanos: nanos as i32 } } - /// Runs a closure, returning the duration of time it took to run the - /// closure. - pub fn span(f: F) -> Duration where F: FnOnce() { - let before = super::precise_time_ns(); - f(); - Duration::nanoseconds((super::precise_time_ns() - before) as i64) - } - /// Returns the total number of whole weeks in the duration. #[inline] pub fn num_weeks(&self) -> i64 {