5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-02-26 21:57:33 +03:00

datastore: use is_{err, some} rather than match {Ok, Some}(_)

Fixes the clippy lint:

```
warning: redundant pattern matching, consider using `is_ok()`
    --> pbs-datastore/src/datastore.rs:1025:10
     |
1025 |         !matches!(self.inner.gc_mutex.try_lock(), Ok(_))
     |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.inner.gc_mutex.try_lock().is_ok()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
     = note: `#[warn(clippy::redundant_pattern_matching)]` on by default
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-02-12 14:17:32 +01:00 committed by Fabian Grünbichler
parent 911279b4f9
commit 1c3f1e7cdf
2 changed files with 2 additions and 2 deletions

View File

@ -1022,7 +1022,7 @@ impl DataStore {
}
pub fn garbage_collection_running(&self) -> bool {
!matches!(self.inner.gc_mutex.try_lock(), Ok(_))
self.inner.gc_mutex.try_lock().is_err()
}
pub fn garbage_collection(

View File

@ -337,7 +337,7 @@ pub fn update_ldap_realm(
config.user_classes = Some(user_classes);
}
let ldap_config = if let Some(_) = password {
let ldap_config = if password.is_some() {
LdapAuthenticator::api_type_to_config_with_password(&config, password.clone())?
} else {
LdapAuthenticator::api_type_to_config(&config)?