tests: Fix clippy error in wait-signal

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2024-01-27 10:27:03 -08:00 committed by John Nunley
parent cf25dd85f8
commit ae484a0a12
1 changed files with 8 additions and 14 deletions

View File

@ -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!(),
}
}
}