From d0128a6d8a8e99976bae1be5aa7b3597893fac23 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 3 Jun 2022 10:31:55 +0200 Subject: Use BoxFuture --- src/server.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index cd15bef..6f3f6ac 100644 --- a/src/server.rs +++ b/src/server.rs @@ -14,6 +14,7 @@ use boitalettres::server::Server as ImapServer; use std::pin::Pin; use std::task::{Context, Poll}; use tower::Service; +use futures::future::BoxFuture; pub struct Server { pub login_provider: Box, @@ -23,7 +24,7 @@ struct Connection; impl Service for Connection { type Response = Response; type Error = anyhow::Error; - type Future = Pin> + Send>>; + type Future = BoxFuture<'static, Result>; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) @@ -62,7 +63,7 @@ struct Instance; impl<'a> Service<&'a AddrStream> for Instance { type Response = Connection; type Error = anyhow::Error; - type Future = Pin> + Send>>; + type Future = BoxFuture<'static, Result>; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) -- cgit v1.2.3