From 3d51aa71158a6912d8d6e2f451155d1dac7fdee8 Mon Sep 17 00:00:00 2001 From: Nikolay Kim <fafhrd91@gmail.com> Date: Mon, 29 Oct 2018 15:40:10 -0700 Subject: [PATCH] no need for mut self for now method --- src/keepalive.rs | 2 +- src/timer.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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<R, E, F> KeepAliveService<R, E, F> 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