mirror of
https://git.proxmox.com/git/proxmox
synced 2026-01-04 03:35:14 +00:00
auth-api: do not clone struct implementing Copy
Fixes the clippy warning:
warning: using `clone` on type `Option<&dyn AuthContext>` which implements the `Copy` trait
--> proxmox-auth-api/src/api/mod.rs:111:5
|
111 | / AUTH_CONTEXT
112 | | .lock()
113 | | .unwrap()
114 | | .clone()
| |________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
help: try dereferencing it
|
111 ~ (*AUTH_CONTEXT
112 + .lock()
113 + .unwrap())
|
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
229cc6ae02
commit
52cf0c05f5
@ -108,11 +108,7 @@ pub fn set_auth_context(auth_context: &'static dyn AuthContext) {
|
||||
}
|
||||
|
||||
fn auth_context() -> Result<&'static dyn AuthContext, Error> {
|
||||
AUTH_CONTEXT
|
||||
.lock()
|
||||
.unwrap()
|
||||
.clone()
|
||||
.ok_or_else(|| format_err!("no realm access configured"))
|
||||
(*AUTH_CONTEXT.lock().unwrap()).ok_or_else(|| format_err!("no realm access configured"))
|
||||
}
|
||||
|
||||
struct UserAuthData {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user