]> git.proxmox.com Git - proxmox.git/commitdiff
rest-server: clippy fixups
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 27 Jul 2022 12:52:06 +0000 (14:52 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 27 Jul 2022 12:54:44 +0000 (14:54 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-rest-server/src/lib.rs
proxmox-rest-server/src/rest.rs

index 3872e5650e451a20d131ebd9bc784ff8822642be..b8a73e35366f504d76ab8c80cd0121db8766a4dc 100644 (file)
@@ -73,6 +73,15 @@ impl From<Error> for AuthError {
     }
 }
 
+/// Result of [`ServerAdapter::check_auth`].
+pub type ServerAdapterCheckAuth<'a> = Pin<
+    Box<
+        dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), 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<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
-                + Send
-                + 'a,
-        >,
-    >;
+    ) -> ServerAdapterCheckAuth<'a>;
 }
 
 lazy_static::lazy_static! {
index 1689ef6e6a06d30fda26721748a9cdd5c9671015..61898d4c25c81069d871bbbfb9630af83adb563c 100644 (file)
@@ -362,7 +362,7 @@ async fn get_request_parameters<S: 'static + BuildHasher + Send>(
     .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"))