mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
build: treewide: clippy: collapse nested ifs, use let chains
This bumps the MSRV to 1.88 (also, Rust edition 2024 is mandatory). 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
Bo Chen
parent
f73a6c8d8e
commit
c995b72384
@@ -624,11 +624,11 @@ impl<T: CpuStateManager> Emulator<'_, T> {
|
||||
last_decoded_ip = decoder.ip();
|
||||
num_insn_emulated += 1;
|
||||
|
||||
if let Some(num_insn) = num_insn {
|
||||
if num_insn_emulated >= num_insn {
|
||||
// Exit the decoding loop, do not decode the next instruction.
|
||||
stop_emulation = true;
|
||||
}
|
||||
if let Some(num_insn) = num_insn
|
||||
&& num_insn_emulated >= num_insn
|
||||
{
|
||||
// Exit the decoding loop, do not decode the next instruction.
|
||||
stop_emulation = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ impl MshvEmulatorContext<'_> {
|
||||
gpa
|
||||
);
|
||||
|
||||
if let Some(vm_ops) = &self.vcpu.vm_ops {
|
||||
if vm_ops.guest_mem_read(gpa, data).is_err() {
|
||||
vm_ops
|
||||
.mmio_read(gpa, data)
|
||||
.map_err(|e| PlatformError::MemoryReadFailure(e.into()))?;
|
||||
}
|
||||
if let Some(vm_ops) = &self.vcpu.vm_ops
|
||||
&& vm_ops.guest_mem_read(gpa, data).is_err()
|
||||
{
|
||||
vm_ops
|
||||
.mmio_read(gpa, data)
|
||||
.map_err(|e| PlatformError::MemoryReadFailure(e.into()))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -94,12 +94,12 @@ impl MshvEmulatorContext<'_> {
|
||||
gpa
|
||||
);
|
||||
|
||||
if let Some(vm_ops) = &self.vcpu.vm_ops {
|
||||
if vm_ops.guest_mem_write(gpa, data).is_err() {
|
||||
vm_ops
|
||||
.mmio_write(gpa, data)
|
||||
.map_err(|e| PlatformError::MemoryWriteFailure(e.into()))?;
|
||||
}
|
||||
if let Some(vm_ops) = &self.vcpu.vm_ops
|
||||
&& vm_ops.guest_mem_write(gpa, data).is_err()
|
||||
{
|
||||
vm_ops
|
||||
.mmio_write(gpa, data)
|
||||
.map_err(|e| PlatformError::MemoryWriteFailure(e.into()))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user