Skip to content

Commit

Permalink
Fix unused warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Apr 18, 2024
1 parent 6552032 commit 4180bcd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use crate::hotplug::PluggableDevice;
enum Event {
Add(PluggedDevice),
Remove(PluggedDevice),
Initialized(Container),
Stopped(Container, i64),
Initialized,
Stopped(i64),
}

impl From<HotPlugEvent> for Event {
Expand All @@ -45,10 +45,10 @@ impl Display for Event {
Event::Remove(dev) => {
write!(f, "Detaching device {dev}")
}
Event::Initialized(_) => {
Event::Initialized => {
write!(f, "Container initialized")
}
Event::Stopped(_, status) => {
Event::Stopped(status) => {
write!(f, "Container exited with status {status}")
}
}
Expand Down Expand Up @@ -80,7 +80,7 @@ fn run_hotplug(
}
}

yield Event::Initialized(container.clone());
yield Event::Initialized;

if !verbosity.is_silent() {
container.attach().await?.pipe_std();
Expand Down Expand Up @@ -114,7 +114,7 @@ async fn run(param: cli::Run, verbosity: Verbosity<InfoLevel>) -> Result<u8> {
let container = container.clone();
async_stream::try_stream! {
let status = container.wait().await?;
yield Event::Stopped(container.clone(), status)
yield Event::Stopped(status)
}
};

Expand All @@ -134,7 +134,7 @@ async fn run(param: cli::Run, verbosity: Verbosity<InfoLevel>) -> Result<u8> {
container.kill(15).await?;
break;
}
Event::Stopped(_, code) => {
Event::Stopped(code) => {
status = 1;
if let Ok(code) = u8::try_from(code) {
// Use the container exit code, but only if it won't be confused
Expand Down

0 comments on commit 4180bcd

Please sign in to comment.