From 5b03f54efb5265c82dc04404d6342864422beeb4 Mon Sep 17 00:00:00 2001 From: GarandPLG Date: Sun, 3 May 2026 22:37:47 +0200 Subject: [PATCH] Drop JoinHandle variables and thread joins Thread handles are no longer kept; spawn threads directly and omit the join calls. The unused `JoinHandle` import and related comments are removed. --- src/main.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5def346..75a7b3e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ use std::{ io::{Result, Stdout}, mem::replace, sync::mpsc::{Receiver, Sender, channel}, - thread::{self, JoinHandle}, + thread, }; use war_in_tunnels::{ app::{ @@ -27,14 +27,12 @@ fn main() -> Result<()> { let input_tx: Sender = channels.input_tx.clone(); let resize_tx: Sender<(u16, u16)> = channels.resize_tx.clone(); - let events_thread: JoinHandle<()> = - thread::spawn(move || handle_ct_events(input_tx, resize_tx)); + thread::spawn(move || handle_ct_events(input_tx, resize_tx)); let tick_tx: Sender<()> = channels.tick_tx.clone(); - let tick_thread: JoinHandle<()> = thread::spawn(move || handle_tick_event(tick_tx, TICK_MS)); + thread::spawn(move || handle_tick_event(tick_tx, TICK_MS)); let audio_rx: Receiver = replace(&mut channels.audio_rx, channel().1); - // let audio_thread: JoinHandle<()> = thread::spawn(move || { handle_audio(audio_rx, args.mute, args.sound_track); }); @@ -46,9 +44,5 @@ fn main() -> Result<()> { ratatui::restore(); - let _ = events_thread.join(); - let _ = tick_thread.join(); - // let _ = audio_thread.join(); // TODO: kill playing music - app_result }