From 42123efe8fd92d6d81b6d5d10ae86866ea9b6a3c Mon Sep 17 00:00:00 2001 From: Aria Date: Sun, 15 Oct 2023 00:57:41 +0100 Subject: some refactors --- echo/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'echo') 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, header: MessageHeader, body: Self::Body, - ) -> impl Future + Send + '_ { + ) -> impl Future + Send + 'a { async move { match body { EchoBody::Echo { msg_id, echo } => { -- cgit v1.2.3