mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
chore: apply rustfmt to all crates (#917)
This commit is contained in:
@@ -2,9 +2,9 @@ use Delay;
|
||||
|
||||
use clock;
|
||||
|
||||
use futures::{Future, Stream, Poll};
|
||||
use futures::{Future, Poll, Stream};
|
||||
|
||||
use std::time::{Instant, Duration};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// A stream representing notifications at fixed interval
|
||||
#[derive(Debug)]
|
||||
@@ -28,7 +28,10 @@ impl Interval {
|
||||
///
|
||||
/// This function panics if `duration` is zero.
|
||||
pub fn new(at: Instant, duration: Duration) -> Interval {
|
||||
assert!(duration > Duration::new(0, 0), "`duration` must be non-zero.");
|
||||
assert!(
|
||||
duration > Duration::new(0, 0),
|
||||
"`duration` must be non-zero."
|
||||
);
|
||||
|
||||
Interval::new_with_delay(Delay::new(at), duration)
|
||||
}
|
||||
@@ -47,10 +50,7 @@ impl Interval {
|
||||
}
|
||||
|
||||
pub(crate) fn new_with_delay(delay: Delay, duration: Duration) -> Interval {
|
||||
Interval {
|
||||
delay,
|
||||
duration,
|
||||
}
|
||||
Interval { delay, duration }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user