aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-03 10:31:55 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-03 10:31:55 +0200
commitd0128a6d8a8e99976bae1be5aa7b3597893fac23 (patch)
treeea1a2e13e3e9807bb5024add1b4907f2fa20957e /src
parent3cb7c65b70250a6a7837291386d0f7f9ebd43ec6 (diff)
downloadaerogramme-d0128a6d8a8e99976bae1be5aa7b3597893fac23.tar.gz
aerogramme-d0128a6d8a8e99976bae1be5aa7b3597893fac23.zip
Use BoxFuture
Diffstat (limited to 'src')
-rw-r--r--src/server.rs5
1 files 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<dyn LoginProvider>,
@@ -23,7 +24,7 @@ struct Connection;
impl Service<Request> for Connection {
type Response = Response;
type Error = anyhow::Error;
- type Future = Pin<Box<dyn futures::Future<Output = Result<Self::Response>> + Send>>;
+ type Future = BoxFuture<'static, Result<Self::Response>>;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
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<Box<dyn futures::Future<Output = Result<Self::Response>> + Send>>;
+ type Future = BoxFuture<'static, Result<Self::Response>>;
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))