diff --git a/src/keepalive.rs b/src/keepalive.rs index fc330f18..b79c6f80 100644 --- a/src/keepalive.rs +++ b/src/keepalive.rs @@ -77,7 +77,7 @@ impl KeepAliveService where F: Fn() -> E, { - pub fn new(ka: Duration, mut timer: LowResTimerService, f: F) -> Self { + pub fn new(ka: Duration, timer: LowResTimerService, f: F) -> Self { let expire = timer.now() + ka; KeepAliveService { f, diff --git a/src/timer.rs b/src/timer.rs index 0acf671f..7b58db00 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -66,7 +66,7 @@ impl LowResTimerService { /// Get current time. This function has to be called from /// future's poll method, otherwise it panics. - pub fn now(&mut self) -> Instant { + pub fn now(&self) -> Instant { let cur = self.0.borrow().current.clone(); if let Some(cur) = cur { cur