]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tree-wide: is_ok/is_err()
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 30 Dec 2021 14:01:31 +0000 (15:01 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 30 Dec 2021 14:02:07 +0000 (15:02 +0100)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
proxmox-file-restore/src/qemu_helper.rs
proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs
src/api2/tape/backup.rs

index eb68f78e2baf30b3206b1e076c89f79f770de9de..79bfb1ec6c24c26d079ef045fac243a4cdfbeaed 100644 (file)
@@ -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<Item = String>,
     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");
     }
 
index fcdb965ca9a75746c9c5e291e33fb09998f82ca2..4e43662e441c497c61f8cdba4ce4f137ee1d5e0a 100644 (file)
@@ -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)",
index 99a717d43f2a56fd7ade4acaa2ea1483f1370cd7..1462f200229c29c449b47ec6b4decb8b478a77a3 100644 (file)
@@ -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");
     }