diff --git a/Cargo.toml b/Cargo.toml index 198bb10f..0605d790 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ heim = "0.0.8" log = "0.4" rayon = "1.2" regex = "1.3.1" -sysinfo = "0.9" +sysinfo = "0.10" tokio = "0.2.4" winapi = "0.3.8" tui = {version = "0.7", features = ["crossterm"], default-features = false } diff --git a/src/main.rs b/src/main.rs index a12938d9..56593d09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -175,15 +175,16 @@ fn main() -> error::Result<()> { } // Event loop - let mut data_state = data_collection::DataState::default(); - data_state.init(); - data_state.set_temperature_type(app.temperature_type.clone()); let (rtx, rrx) = mpsc::channel(); { let tx = tx.clone(); let mut first_run = true; + let temp_type = app.temperature_type.clone(); thread::spawn(move || { let tx = tx.clone(); + let mut data_state = data_collection::DataState::default(); + data_state.init(); + data_state.set_temperature_type(temp_type); loop { if let Ok(message) = rrx.try_recv() { match message {