[pbs-devel] [PATCH proxmox 05/15] clippy fix: unneeded `return` statement

Lukas Wagner l.wagner at proxmox.com
Tue Aug 8 10:01:43 CEST 2023


See:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 proxmox-rest-server/src/rest.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs
index b4f35aa..252532a 100644
--- a/proxmox-rest-server/src/rest.rs
+++ b/proxmox-rest-server/src/rest.rs
@@ -785,11 +785,11 @@ impl ApiConfig {
                 }
                 Err(AuthError::NoData) => {}
             }
-            return Ok(self.get_index(rpcenv, parts).await);
+            Ok(self.get_index(rpcenv, parts).await)
         } else {
             let filename = self.find_alias(&components);
             let compression = extract_compression_method(&parts.headers);
-            return handle_static_file_download(&components, filename, compression).await;
+            handle_static_file_download(&components, filename, compression).await
         }
     }
 }
@@ -926,7 +926,7 @@ impl Formatted {
         match api_method {
             None => {
                 let err = http_err!(NOT_FOUND, "Path '{}' not found.", full_path);
-                return Ok(formatter.format_error(err));
+                Ok(formatter.format_error(err))
             }
             Some(api_method) => {
                 let auth_id = rpcenv.get_auth_id();
@@ -962,7 +962,7 @@ impl Formatted {
                         .insert(AuthStringExtension(auth_id));
                 }
 
-                return Ok(response);
+                Ok(response)
             }
         }
     }
@@ -1067,7 +1067,7 @@ impl Unformatted {
                         .insert(AuthStringExtension(auth_id));
                 }
 
-                return Ok(response);
+                Ok(response)
             }
         }
     }
-- 
2.39.2






More information about the pbs-devel mailing list