Skip to content

Commit

Permalink
tests: Fix clippy error in wait-signal
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull committed Jan 28, 2024
1 parent cf25dd8 commit ae484a0
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions examples/wait-signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,16 @@ mod example {

println!("Press Ctrl+C to exit...");

loop {
// Wait for events.
poller.wait(&mut events, None).unwrap();
// Wait for events.
poller.wait(&mut events, None).unwrap();

// Process events.
for ev in events.iter() {
match ev.key {
1 => {
println!("SIGINT received");
return;
}
_ => unreachable!(),
}
// Process events.
let ev = events.iter().next().unwrap();
match ev.key {
1 => {
println!("SIGINT received");
}

events.clear();
_ => unreachable!(),
}
}
}
Expand Down

0 comments on commit ae484a0

Please sign in to comment.