From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 674A16AF04 for ; Mon, 25 Jan 2021 14:43:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6575EACBF for ; Mon, 25 Jan 2021 14:43:21 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id E268FACB5 for ; Mon, 25 Jan 2021 14:43:20 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B0A9E45717 for ; Mon, 25 Jan 2021 14:43:20 +0100 (CET) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pbs-devel@lists.proxmox.com Date: Mon, 25 Jan 2021 14:42:49 +0100 Message-Id: <20210125134302.3394328-5-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210125134302.3394328-1-f.gruenbichler@proxmox.com> References: <20210125134302.3394328-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.026 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup 04/15] allow complex Futures in tower_service impl X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 13:43:21 -0000 Signed-off-by: Fabian Grünbichler --- src/server/h2service.rs | 5 +++-- src/server/rest.rs | 3 ++- src/tools/http.rs | 5 ++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/server/h2service.rs b/src/server/h2service.rs index 989618ec..332b3b1a 100644 --- a/src/server/h2service.rs +++ b/src/server/h2service.rs @@ -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 H2Service { impl tower_service::Service> for H2Service { type Response = Response; type Error = Error; - type Future = - std::pin::Pin, Self::Error>> + Send>>; + #[allow(clippy::type_complexity)] + type Future = Pin> + Send>>; fn poll_ready(&mut self, _cx: &mut Context) -> Poll> { Poll::Ready(Ok(())) diff --git a/src/server/rest.rs b/src/server/rest.rs index 0586979a..fc59be9a 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -198,7 +198,8 @@ fn get_user_agent(headers: &HeaderMap) -> Option { impl tower_service::Service> for ApiService { type Response = Response; type Error = Error; - type Future = Pin, Self::Error>> + Send>>; + #[allow(clippy::type_complexity)] + type Future = Pin> + Send>>; fn poll_ready(&mut self, _cx: &mut Context) -> Poll> { Poll::Ready(Ok(())) diff --git a/src/tools/http.rs b/src/tools/http.rs index 47d6e1f6..0fbc85fb 100644 --- a/src/tools/http.rs +++ b/src/tools/http.rs @@ -108,9 +108,8 @@ type MaybeTlsStream = EitherStream< impl hyper::service::Service for HttpsConnector { type Response = MaybeTlsStream; type Error = Error; - type Future = std::pin::Pin> + Send + 'static - >>; + #[allow(clippy::type_complexity)] + type Future = Pin> + Send + 'static>>; fn poll_ready(&mut self, _: &mut Context<'_>) -> Poll> { // This connector is always ready, but others might not be. -- 2.20.1