Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Fix clippy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed Jan 23, 2024
1 parent 0a24475 commit b4b85f9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@ use std::thread;
pub fn init(shutdown: Arc<Shutdown>) {
let mut signals = Signals::new([SIGINT, SIGTERM]).expect("failed to init signal handler");
thread::spawn(move || {
for signal in signals.forever() {
if let Some(signal) = signals.forever().next() {
info!("signal: {}", signal);
match signal {
SIGINT | SIGTERM => {
shutdown.shutdown();
break;
}
_ => unreachable!(),
}
assert!(matches!(signal, SIGINT | SIGTERM));
shutdown.shutdown();
}
});
}

0 comments on commit b4b85f9

Please sign in to comment.