aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer.rs
diff options
context:
space:
mode:
authorJake McGinty <me@jake.su>2018-02-15 23:59:10 +0000
committerJake McGinty <me@jake.su>2018-02-15 23:59:10 +0000
commit25c1b4fdf419c9e859fa7cc896b477f79d0cb2ff (patch)
treebdddb8bfdc1952d91794ae8e29963a0f3219c76f /src/timer.rs
parentsupport REJECT_AFTER_TIME (diff)
downloadwireguard-rs-25c1b4fdf419c9e859fa7cc896b477f79d0cb2ff.tar.xz
wireguard-rs-25c1b4fdf419c9e859fa7cc896b477f79d0cb2ff.zip
clippytime
Diffstat (limited to 'src/timer.rs')
-rw-r--r--src/timer.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/timer.rs b/src/timer.rs
index f96d1de..6f8a64a 100644
--- a/src/timer.rs
+++ b/src/timer.rs
@@ -18,13 +18,15 @@ pub struct Timer {
rx: unsync::mpsc::Receiver<TimerMessage>,
}
-impl Timer {
- pub fn new() -> Self {
+impl Default for Timer {
+ fn default() -> Self {
let (tx, rx) = unsync::mpsc::channel::<TimerMessage>(1024);
let timer = tokio_timer::Timer::default();
Self { timer, tx, rx }
}
+}
+impl Timer {
pub fn spawn_delayed(&mut self, handle: &Handle, delay: Duration, message: TimerMessage) {
trace!("queuing timer message {:?}", &message);
let timer = self.timer.sleep(delay);