diff --git a/src/app/threads/mod.rs b/src/app/threads/mod.rs index 24050fd..99579a6 100644 --- a/src/app/threads/mod.rs +++ b/src/app/threads/mod.rs @@ -4,4 +4,4 @@ mod tick; pub use audio::{AudioCmd, SoundrackParts, Soundtrack, handle_audio}; pub use events::handle_ct_events; -pub use tick::handle_tick_event; +pub use tick::{TICK_MS, handle_tick_event}; diff --git a/src/app/threads/tick.rs b/src/app/threads/tick.rs index 3eb0a1f..58a457c 100644 --- a/src/app/threads/tick.rs +++ b/src/app/threads/tick.rs @@ -4,8 +4,10 @@ use std::{ time::{Duration, Instant}, }; -pub fn handle_tick_event(tx: Sender<()>, tick_ms: u8) { - let interval: Duration = Duration::from_millis(tick_ms as u64); +pub const TICK_MS: u8 = 33; + +pub fn handle_tick_event(tx: Sender<()>) { + let interval: Duration = Duration::from_millis(TICK_MS as u64); loop { if tx.send(()).is_err() { break; diff --git a/src/main.rs b/src/main.rs index 0483af5..b5989b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,8 +12,6 @@ use war_in_tunnels::{ cli::{Cli, get_args}, }; -const TICK_MS: u8 = 33; - /// Starts the terminal UI application. /// /// The function follows the steps outlined in the module‑level documentation. @@ -28,7 +26,7 @@ fn main() -> Result<()> { let (audio_tx, audio_rx) = channel::(); thread::spawn(move || handle_ct_events(input_tx, resize_tx)); - thread::spawn(move || handle_tick_event(tick_tx, TICK_MS)); + thread::spawn(move || handle_tick_event(tick_tx)); thread::spawn(move || handle_audio(audio_rx, args.mute, args.soundtrack)); let mut terminal: Terminal> = ratatui::init();