From a0729d391319e8b6fe8a94aac1ff4ba75a2e9425 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Fri, 13 Dec 2019 02:45:09 -0500 Subject: [PATCH] Fix for winapi --- Cargo.toml | 2 +- src/main.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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 {