Skip to content

Commit

Permalink
fix: remove unused terminal tick event (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed May 20, 2024
1 parent 3871647 commit 39da120
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use std::time::{Duration, Instant};
/// Terminal events.
#[derive(Clone, Debug)]
pub enum Event {
/// Terminal tick.
Tick,
/// Key press.
Key(KeyEvent),
/// Mouse click/scroll.
Expand Down Expand Up @@ -60,9 +58,7 @@ impl EventHandler {
}
.expect("failed to send terminal event")
}

if last_tick.elapsed() >= tick_rate {
sender.send(Event::Tick).expect("failed to send tick event");
last_tick = Instant::now();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ fn main() -> AppResult<()> {
tui.draw(&mut app)?;
// Handle events.
match tui.events.next()? {
Event::Tick => {}
Event::Key(key_event) => handle_key_events(key_event, &mut app, &tui.events.sender)?,
Event::Mouse(mouse_event) => {
handle_mouse_events(mouse_event, &mut app, &tui.events.sender)?
Expand Down

0 comments on commit 39da120

Please sign in to comment.