Skip to content

Commit

Permalink
fix: fix clippy issue with for loop that only ever inspects the first…
Browse files Browse the repository at this point in the history
… item
  • Loading branch information
joshka committed May 5, 2024
1 parent 7e5d5ab commit 09cf056
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions src/event/source/unix/mio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,18 @@ impl EventSource for UnixInternalEventSource {
}
}
SIGNAL_TOKEN => {
for signal in self.signals.pending() {
match signal {
signal_hook::consts::SIGWINCH => {
// TODO Should we remove tput?
//
// This can take a really long time, because terminal::size can
// launch new process (tput) and then it parses its output. It's
// not a really long time from the absolute time point of view, but
// it's a really long time from the mio, async-std/tokio executor, ...
// point of view.
let new_size = crate::terminal::size()?;
return Ok(Some(InternalEvent::Event(Event::Resize(
new_size.0, new_size.1,
))));
}
_ => unreachable!("Synchronize signal registration & handling"),
};
if self.signals.pending().next() == Some(signal_hook::consts::SIGWINCH) {
// TODO Should we remove tput?
//
// This can take a really long time, because terminal::size can
// launch new process (tput) and then it parses its output. It's
// not a really long time from the absolute time point of view, but
// it's a really long time from the mio, async-std/tokio executor, ...
// point of view.
let new_size = crate::terminal::size()?;
return Ok(Some(InternalEvent::Event(Event::Resize(
new_size.0, new_size.1,
))));
}
}
#[cfg(feature = "event-stream")]
Expand Down

0 comments on commit 09cf056

Please sign in to comment.