Clippy suggestions

This commit is contained in:
Marco De Araujo 2026-01-19 06:28:25 -04:00
parent 00cb8f7a9b
commit c48a37d56a
5 changed files with 22 additions and 22 deletions

View file

@ -159,7 +159,7 @@ impl App {
let seconds_until_update = self
.update_interval
.checked_sub(self.last_update.elapsed())
.map(|d| d.as_secs() as u64)
.map(|d| d.as_secs())
.unwrap_or(30);
render_footer(frame, chunks[2], seconds_until_update);
@ -198,20 +198,20 @@ impl App {
fn handle_events(&mut self) -> io::Result<()> {
let timeout = Duration::from_secs(1);
if event::poll(timeout)? {
if let Event::Key(key) = event::read()? {
if key.kind == KeyEventKind::Release {
return Ok(());
}
if event::poll(timeout)?
&& let Event::Key(key) = event::read()?
{
if key.kind == KeyEventKind::Release {
return Ok(());
}
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.should_quit = true,
KeyCode::Up | KeyCode::Char('k') => self.state.scroll_state.prev(),
KeyCode::Down | KeyCode::Char('j') => self.state.scroll_state.next(),
KeyCode::Home => self.state.scroll_state.first(),
KeyCode::End => self.state.scroll_state.last(),
_ => {}
}
match key.code {
KeyCode::Char('q') | KeyCode::Esc => self.should_quit = true,
KeyCode::Up | KeyCode::Char('k') => self.state.scroll_state.prev(),
KeyCode::Down | KeyCode::Char('j') => self.state.scroll_state.next(),
KeyCode::Home => self.state.scroll_state.first(),
KeyCode::End => self.state.scroll_state.last(),
_ => {}
}
}
Ok(())