clippy: is_some/none/ok/err/empty

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler committed 2021-01-20 16:23:54 +01:00
1 parent 397356096a
commit 3984a5fd77
22 files changed
+38 -42

No files matched your search

+3 -3
View File
@@ -711,7 +711,7 @@ pub fn verify(
verify_all_backups(datastore, worker.clone(), worker.upid(), owner, None)?
};
if failed_dirs.len() > 0 {
if !failed_dirs.is_empty() {
worker.log("Failed to verify the following snapshots/groups:");
for dir in failed_dirs {
worker.log(format!("\t{}", dir));
@@ -1341,7 +1341,7 @@ fn catalog(
if filepath != "root" {
components = base64::decode(filepath)?;
if components.len() > 0 && components[0] == '/' as u8 {
if !components.is_empty() && components[0] == b'/' {
components.remove(0);
}
for component in components.split(|c| *c == '/' as u8) {
@@ -1487,7 +1487,7 @@ fn pxar_file_download(
check_priv_or_backup_owner(&datastore, backup_dir.group(), &auth_id, PRIV_DATASTORE_READ)?;
let mut components = base64::decode(&filepath)?;
if components.len() > 0 && components[0] == '/' as u8 {
if !components.is_empty() && components[0] == b'/' {
components.remove(0);
}