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
@@ -213,16 +213,16 @@ impl Blk {
|
||||
|
||||
impl Drop for Blk {
|
||||
fn drop(&mut self) {
|
||||
if let Some(kill_evt) = self.common.kill_evt.take() {
|
||||
if let Err(e) = kill_evt.write(1) {
|
||||
error!("failed to kill vhost-user-blk: {:?}", e);
|
||||
}
|
||||
if let Some(kill_evt) = self.common.kill_evt.take()
|
||||
&& let Err(e) = kill_evt.write(1)
|
||||
{
|
||||
error!("failed to kill vhost-user-blk: {:?}", e);
|
||||
}
|
||||
self.common.wait_for_epoll_threads();
|
||||
if let Some(thread) = self.epoll_thread.take() {
|
||||
if let Err(e) = thread.join() {
|
||||
error!("Error joining thread: {:?}", e);
|
||||
}
|
||||
if let Some(thread) = self.epoll_thread.take()
|
||||
&& let Err(e) = thread.join()
|
||||
{
|
||||
error!("Error joining thread: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,16 +267,15 @@ impl VirtioDevice for Blk {
|
||||
}
|
||||
|
||||
self.config.writeback = data[0];
|
||||
if let Some(vu) = &self.vu_common.vu {
|
||||
if let Err(e) = vu
|
||||
if let Some(vu) = &self.vu_common.vu
|
||||
&& let Err(e) = vu
|
||||
.lock()
|
||||
.unwrap()
|
||||
.socket_handle()
|
||||
.set_config(offset as u32, VhostUserConfigFlags::WRITABLE, data)
|
||||
.map_err(Error::VhostUserSetConfig)
|
||||
{
|
||||
error!("Failed setting vhost-user-blk configuration: {:?}", e);
|
||||
}
|
||||
{
|
||||
error!("Failed setting vhost-user-blk configuration: {:?}", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,11 +328,11 @@ impl VirtioDevice for Blk {
|
||||
self.common.resume().ok()?;
|
||||
}
|
||||
|
||||
if let Some(vu) = &self.vu_common.vu {
|
||||
if let Err(e) = vu.lock().unwrap().reset_vhost_user() {
|
||||
error!("Failed to reset vhost-user daemon: {:?}", e);
|
||||
return None;
|
||||
}
|
||||
if let Some(vu) = &self.vu_common.vu
|
||||
&& let Err(e) = vu.lock().unwrap().reset_vhost_user()
|
||||
{
|
||||
error!("Failed to reset vhost-user daemon: {:?}", e);
|
||||
return None;
|
||||
}
|
||||
|
||||
if let Some(kill_evt) = self.common.kill_evt.take() {
|
||||
|
||||
Reference in New Issue
Block a user