From 00f16b4e948fcdab6daada84a7e4ee1c133a4605 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 27 Jul 2022 14:52:06 +0200 Subject: [PATCH] rest-server: clippy fixups Signed-off-by: Wolfgang Bumiller --- proxmox-rest-server/src/lib.rs | 17 ++++++++++------- proxmox-rest-server/src/rest.rs | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/proxmox-rest-server/src/lib.rs b/proxmox-rest-server/src/lib.rs index 3872e565..b8a73e35 100644 --- a/proxmox-rest-server/src/lib.rs +++ b/proxmox-rest-server/src/lib.rs @@ -73,6 +73,15 @@ impl From for AuthError { } } +/// Result of [`ServerAdapter::check_auth`]. +pub type ServerAdapterCheckAuth<'a> = Pin< + Box< + dyn Future), AuthError>> + + Send + + 'a, + >, +>; + /// User Authentication and index/root page generation methods pub trait ServerAdapter: Send + Sync { /// Returns the index/root page @@ -90,13 +99,7 @@ pub trait ServerAdapter: Send + Sync { &'a self, headers: &'a HeaderMap, method: &'a Method, - ) -> Pin< - Box< - dyn Future), AuthError>> - + Send - + 'a, - >, - >; + ) -> ServerAdapterCheckAuth<'a>; } lazy_static::lazy_static! { diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs index 1689ef6e..61898d4c 100644 --- a/proxmox-rest-server/src/rest.rs +++ b/proxmox-rest-server/src/rest.rs @@ -362,7 +362,7 @@ async fn get_request_parameters( .try_fold(Vec::new(), |mut acc, chunk| async move { // FIXME: max request body size? if acc.len() + chunk.len() < 64 * 1024 { - acc.extend_from_slice(&*chunk); + acc.extend_from_slice(&chunk); Ok(acc) } else { Err(http_err!(BAD_REQUEST, "Request body too large"))