From 229cc6ae020fd20ed123693a7817940fe4c4e780 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Wed, 26 Jun 2024 14:43:44 +0200 Subject: [PATCH] acl: directly return struct rather than a binding 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 --- 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