Skip to content

Commit

Permalink
Remove dependencies from oldtime::Duration on rest of time crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jethro Beekman committed Mar 30, 2018
1 parent 5e730eb commit 6c398ae
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/oldtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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: 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 {
Expand Down

0 comments on commit 6c398ae

Please sign in to comment.