tree-wide: is_ok/is_err()

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-12-30 15:01:31 +01:00
parent 3afecb8409
commit 6f1c26b083
3 changed files with 4 additions and 4 deletions

View 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");
}

View 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)",

View 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");
}