diff options
author | Aria <me@aria.rip> | 2023-10-15 00:57:41 +0100 |
---|---|---|
committer | Aria <me@aria.rip> | 2023-10-15 00:57:41 +0100 |
commit | 42123efe8fd92d6d81b6d5d10ae86866ea9b6a3c (patch) | |
tree | 2dfcb1a27c337d1c9b89f54aff35e94795970b74 /echo | |
parent | 7447f3fb801ba954c7b8cbf3f47700ffcc562d20 (diff) |
some refactors
Diffstat (limited to 'echo')
-rw-r--r-- | echo/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/echo/src/main.rs b/echo/src/main.rs index 424a538..cdd3f3b 100644 --- a/echo/src/main.rs +++ b/echo/src/main.rs @@ -1,5 +1,5 @@ #![feature(return_position_impl_trait_in_trait)] -use std::future::Future; +use std::{future::Future, sync::Arc}; use common::{ msg::*, @@ -37,11 +37,11 @@ impl Handler for EchoHandler { EchoHandler { output } } - fn handle( - &self, + fn handle<'a>( + self: &'a Arc<Self>, header: MessageHeader, body: Self::Body, - ) -> impl Future<Output = ()> + Send + '_ { + ) -> impl Future<Output = ()> + Send + 'a { async move { match body { EchoBody::Echo { msg_id, echo } => { |