mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: clippy: add if_not_else
This removes cognitive load when reading if statements. All changes were applied by clippy via `--fix`. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
a0b72dce22
commit
0a07c96d17
@@ -463,12 +463,12 @@ impl VirtioDevice for Vdpa {
|
||||
|
||||
impl Pausable for Vdpa {
|
||||
fn pause(&mut self) -> std::result::Result<(), MigratableError> {
|
||||
if !self.migrating {
|
||||
if self.migrating {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(MigratableError::Pause(anyhow!(
|
||||
"Can't pause a vDPA device outside live migration"
|
||||
)))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,12 +477,12 @@ impl Pausable for Vdpa {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if !self.migrating {
|
||||
if self.migrating {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(MigratableError::Resume(anyhow!(
|
||||
"Can't resume a vDPA device outside live migration"
|
||||
)))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user