diff --git a/proxmox-file-restore/src/qemu_helper.rs b/proxmox-file-restore/src/qemu_helper.rs index eb68f78e..79bfb1ec 100644 --- a/proxmox-file-restore/src/qemu_helper.rs +++ b/proxmox-file-restore/src/qemu_helper.rs @@ -60,7 +60,7 @@ fn validate_img_existance(debug: bool) -> Result<(), Error> { pub fn try_kill_vm(pid: i32) -> Result<(), Error> { let pid = Pid::from_raw(pid); - if let Ok(()) = kill(pid, None) { + if kill(pid, None).is_ok() { // process is running (and we could kill it), check if it is actually ours // (if it errors assume we raced with the process's death and ignore it) if let Ok(cmdline) = file_read_string(format!("/proc/{}/cmdline", pid)) { @@ -129,7 +129,7 @@ pub async fn start_vm( files: impl Iterator, ticket: &str, ) -> Result<(i32, i32), Error> { - if let Err(_) = std::env::var("PBS_PASSWORD") { + if std::env::var("PBS_PASSWORD").is_err() { bail!("environment variable PBS_PASSWORD has to be set for QEMU VM restore"); } diff --git a/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs b/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs index fcdb965c..4e43662e 100644 --- a/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs +++ b/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs @@ -405,7 +405,7 @@ impl DiskState { mountpoint: None, size, }); - if let Ok(_) = filesystems.ensure_mounted(&mut dfs_bucket) { + if filesystems.ensure_mounted(&mut dfs_bucket).is_ok() { // mount succeeded, add bucket and skip any other checks for the disk info!( "drive '{}' ('{}', '{}') contains fs directly ({}B)", diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs index 99a717d4..1462f200 100644 --- a/src/api2/tape/backup.rs +++ b/src/api2/tape/backup.rs @@ -642,7 +642,7 @@ pub fn backup_snapshot( } } - if let Err(_) = reader_thread.join() { + if reader_thread.join().is_err() { bail!("chunk reader thread failed"); }