chore(code): simple code cleanup

This commit is contained in:
2024-07-20 23:08:59 -07:00
parent d792eb5439
commit 5293a4ec45
15 changed files with 18 additions and 19 deletions

View File

@@ -51,7 +51,7 @@ impl ControlCommand {
ControlCommands::Device(device) => device.run(client, events).await,
ControlCommands::Host(snoop) => snoop.run(client, events).await,
ControlCommands::Host(host) => host.run(client, events).await,
}
}
}

View File

@@ -106,7 +106,7 @@ impl ZoneTopApp {
break;
}
}
};
}
}
Ok(())
}

View File

@@ -265,7 +265,7 @@ impl ControlService for DaemonControlService {
break;
}
}
};
}
}
};

View File

@@ -198,7 +198,7 @@ impl DaemonIdm {
break;
}
}
};
}
}
Ok(())
}

View File

@@ -132,7 +132,7 @@ impl ZoneReconciler {
error!("runtime reconciler failed: {}", error);
}
}
};
}
}
}))
}

View File

@@ -33,7 +33,7 @@ use super::{
type OneshotRequestMap<R> = Arc<Mutex<HashMap<u64, oneshot::Sender<<R as IdmRequest>::Response>>>>;
type StreamRequestMap<R> = Arc<Mutex<HashMap<u64, Sender<<R as IdmRequest>::Response>>>>;
type StreamRequestUpdateMap<R> = Arc<Mutex<HashMap<u64, mpsc::Sender<R>>>>;
type StreamRequestUpdateMap<R> = Arc<Mutex<HashMap<u64, Sender<R>>>>;
pub type IdmInternalClient = IdmClient<internal::Request, internal::Event>;
const IDM_PACKET_QUEUE_LEN: usize = 100;

View File

@@ -187,7 +187,7 @@ impl AutoNetworkWatcher {
_ = sleep(Duration::from_secs(10)) => {
break;
}
};
}
}
Ok(())
}

View File

@@ -25,7 +25,7 @@ async fn main() -> Result<()> {
let (context, mut receiver) = OciProgressContext::create();
tokio::task::spawn(async move {
loop {
if (receiver.changed().await).is_err() {
if receiver.changed().await.is_err() {
break;
}
let progress = receiver.borrow_and_update();

View File

@@ -97,13 +97,13 @@ impl OciPackerBackend for OciPackerMkSquashfs {
status = &mut wait => {
break status;
}
};
}
} else {
select! {
status = &mut wait => {
break status;
}
};
}
}
};
if let Some(writer) = writer {
@@ -172,13 +172,13 @@ impl OciPackerBackend for OciPackerMkfsErofs {
status = &mut wait => {
break status;
}
};
}
} else {
select! {
status = &mut wait => {
break status;
}
};
}
}
};
if let Some(writer) = writer {

View File

@@ -228,7 +228,7 @@ impl OciBoundProgress {
context.update(&progress);
let mut receiver = self.context.subscribe();
tokio::task::spawn(async move {
while (receiver.changed().await).is_ok() {
while receiver.changed().await.is_ok() {
context
.sender
.send_replace(receiver.borrow_and_update().clone());

View File

@@ -505,7 +505,7 @@ impl KrataChannelBackendProcessor {
}
}
}
};
}
}
Ok(())
}

View File

@@ -130,8 +130,7 @@ impl<P: BootSetupPlatform> XenClient<P> {
match self.init(created.domid, config, &created).await {
Ok(_) => Ok(created),
Err(err) => {
// ignore since destroying a domain is best
// effort when an error occurs
// ignore since destroying a domain is best-effort when an error occurs
let _ = self.domain_manager.destroy(created.domid).await;
Err(err)
}

View File

@@ -210,7 +210,7 @@ impl EventChannel {
}
}
}
};
}
}
Ok(())

View File

@@ -297,7 +297,7 @@ impl XsdSocketProcessor {
break;
}
}
};
}
}
Ok(())
}

View File

@@ -91,7 +91,7 @@ impl ZoneBackground {
break;
}
}
};
}
}
Ok(())
}