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:
Philipp Schuster
2025-08-15 09:00:01 +02:00
committed by Bo Chen
parent f73a6c8d8e
commit c995b72384
40 changed files with 574 additions and 608 deletions

View File

@@ -601,10 +601,10 @@ impl BusDevice for CpuManager {
state.removing = false;
}
// Trigger removal of vCPU
if data[0] & (1 << CPU_EJECT_FLAG) == 1 << CPU_EJECT_FLAG {
if let Err(e) = self.remove_vcpu(self.selected_cpu as u32) {
error!("Error removing vCPU: {:?}", e);
}
if data[0] & (1 << CPU_EJECT_FLAG) == 1 << CPU_EJECT_FLAG
&& let Err(e) = self.remove_vcpu(self.selected_cpu as u32)
{
error!("Error removing vCPU: {:?}", e);
}
} else {
warn!("Out of range vCPU id: {}", self.selected_cpu);
@@ -1059,14 +1059,13 @@ impl CpuManager {
}
// Apply seccomp filter for vcpu thread.
if !vcpu_seccomp_filter.is_empty() {
if let Err(e) =
if !vcpu_seccomp_filter.is_empty() && let Err(e) =
apply_filter(&vcpu_seccomp_filter).map_err(Error::ApplySeccompFilter)
{
error!("Error applying seccomp filter: {:?}", e);
return;
}
}
extern "C" fn handle_signal(_: i32, _: *mut siginfo_t, _: *mut c_void) {}
// This uses an async signal safe handler to kill the vcpu handles.
register_signal_handler(SIGRTMIN(), handle_signal)