diff --git a/util/io/src/service.rs b/util/io/src/service.rs index 123d90938..632af8d77 100644 --- a/util/io/src/service.rs +++ b/util/io/src/service.rs @@ -249,7 +249,8 @@ impl Handler for IoManager where Message: Send + Clone + Sync let handler_index = token.0 / TOKENS_PER_HANDLER; let token_id = token.0 % TOKENS_PER_HANDLER; if let Some(handler) = self.handlers.read().get(handler_index) { - if let Some(timer) = self.timers.read().get(&token.0) { + let maybe_timer = self.timers.read().get(&token.0).cloned(); + if let Some(timer) = maybe_timer { if timer.once { self.timers.write().remove(&token_id); event_loop.clear_timeout(&timer.timeout);