mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-27 22:32:57 +01:00
no need for mut self for now method
This commit is contained in:
parent
a8a831a098
commit
3d51aa7115
@ -77,7 +77,7 @@ impl<R, E, F> KeepAliveService<R, E, F>
|
|||||||
where
|
where
|
||||||
F: Fn() -> E,
|
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;
|
let expire = timer.now() + ka;
|
||||||
KeepAliveService {
|
KeepAliveService {
|
||||||
f,
|
f,
|
||||||
|
@ -66,7 +66,7 @@ impl LowResTimerService {
|
|||||||
|
|
||||||
/// Get current time. This function has to be called from
|
/// Get current time. This function has to be called from
|
||||||
/// future's poll method, otherwise it panics.
|
/// 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();
|
let cur = self.0.borrow().current.clone();
|
||||||
if let Some(cur) = cur {
|
if let Some(cur) = cur {
|
||||||
cur
|
cur
|
||||||
|
Loading…
Reference in New Issue
Block a user