[pbs-devel] [PATCH proxmox v2 16/18] acl: directly return struct rather than a binding

Maximiliano Sandoval m.sandoval at proxmox.com
Wed Jun 26 14:43:44 CEST 2024


Fixes the following clippy warning:

warning: returning the result of a `let` binding from a block
   --> proxmox-access-control/src/acl.rs:687:13
    |
686 |             let config = TestAcmConfig { roles };
    |             ------------------------------------- unnecessary `let` binding
687 |             config
    |             ^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
686 ~
687 ~             TestAcmConfig { roles }
    |

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-access-control/src/acl.rs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/proxmox-access-control/src/acl.rs b/proxmox-access-control/src/acl.rs
index af68159c..80f71367 100644
--- a/proxmox-access-control/src/acl.rs
+++ b/proxmox-access-control/src/acl.rs
@@ -683,8 +683,7 @@ mod test {
             roles.insert("DatastoreBackup", 4);
             roles.insert("DatastoreReader", 8);
 
-            let config = TestAcmConfig { roles };
-            config
+            TestAcmConfig { roles }
         });
 
         // ignore errors here, we don't care if it's initialized already
-- 
2.39.2





More information about the pbs-devel mailing list