]> git.proxmox.com Git - proxmox-backup.git/commitdiff
allow complex Futures in tower_service impl
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 25 Jan 2021 13:42:49 +0000 (14:42 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 26 Jan 2021 08:53:55 +0000 (09:53 +0100)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/server/h2service.rs
src/server/rest.rs
src/tools/http.rs

index 989618ec62989f4e1c85216791242b97e0c11bb6..332b3b1a860e4080860fa5527db6c695dfc2f1b0 100644 (file)
@@ -1,6 +1,7 @@
 use anyhow::{Error};
 
 use std::collections::HashMap;
+use std::pin::Pin;
 use std::sync::Arc;
 use std::task::{Context, Poll};
 
@@ -85,8 +86,8 @@ impl <E: RpcEnvironment + Clone> H2Service<E> {
 impl <E: RpcEnvironment + Clone> tower_service::Service<Request<Body>> for H2Service<E> {
     type Response = Response<Body>;
     type Error = Error;
-    type Future =
-        std::pin::Pin<Box<dyn Future<Output = Result<Response<Body>, Self::Error>> + Send>>;
+    #[allow(clippy::type_complexity)]
+    type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;
 
     fn poll_ready(&mut self, _cx: &mut Context) -> Poll<Result<(), Self::Error>> {
         Poll::Ready(Ok(()))
index 0586979a6ef1343735ffb7313b7e9a1638b56af8..fc59be9ab6e12c4c39f7039e3d6683b3539cf66c 100644 (file)
@@ -198,7 +198,8 @@ fn get_user_agent(headers: &HeaderMap) -> Option<String> {
 impl tower_service::Service<Request<Body>> for ApiService {
     type Response = Response<Body>;
     type Error = Error;
-    type Future = Pin<Box<dyn Future<Output = Result<Response<Body>, Self::Error>> + Send>>;
+    #[allow(clippy::type_complexity)]
+    type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;
 
     fn poll_ready(&mut self, _cx: &mut Context) -> Poll<Result<(), Self::Error>> {
         Poll::Ready(Ok(()))
index 47d6e1f6da72b8619d09ba368ddc9e00f63e4d33..0fbc85fbddd88a83cadfa3bc0c17bbeaa22921a1 100644 (file)
@@ -108,9 +108,8 @@ type MaybeTlsStream = EitherStream<
 impl hyper::service::Service<Uri> for HttpsConnector {
     type Response = MaybeTlsStream;
     type Error = Error;
-    type Future = std::pin::Pin<Box<
-        dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static
-    >>;
+    #[allow(clippy::type_complexity)]
+    type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>;
 
     fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
         // This connector is always ready, but others might not be.