diff --git a/Cargo.lock b/Cargo.lock index 8b50515b..870b6958 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -219,7 +219,6 @@ dependencies = [ "ctrlc", "dirs", "fern", - "flume", "futures", "futures-timer", "fxhash", @@ -264,12 +263,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - [[package]] name = "byteorder" version = "1.4.3" @@ -584,19 +577,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "flume" -version = "0.10.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "pin-project", - "spin", -] - [[package]] name = "fnv" version = "1.0.7" @@ -729,10 +709,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.10.2+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -947,15 +925,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" -[[package]] -name = "js-sys" -version = "0.3.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "kstring" version = "2.0.0" @@ -1072,15 +1041,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", -] - [[package]] name = "nix" version = "0.19.1" @@ -1263,26 +1223,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.9" @@ -1570,15 +1510,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "spin" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" -dependencies = [ - "lock_api", -] - [[package]] name = "starship-battery" version = "0.7.9" @@ -1831,60 +1762,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" - [[package]] name = "wepoll-ffi" version = "0.1.2" diff --git a/Cargo.toml b/Cargo.toml index bc9dd6b3..96b7a01c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,6 @@ crossterm = "0.25.0" ctrlc = { version = "3.1.9", features = ["termination"] } dirs = "4.0.0" fern = { version = "0.6.1", optional = true } -flume = "0.10.14" futures = "0.3.21" futures-timer = "3.0.2" fxhash = "0.2.1" diff --git a/src/bin/main.rs b/src/bin/main.rs index 2130ecb3..ae6cce84 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -10,7 +10,7 @@ use std::{ panic, sync::{ atomic::{AtomicBool, Ordering}, - Arc, Condvar, Mutex, + mpsc, Arc, Condvar, Mutex, }, thread, time::Duration, @@ -77,7 +77,7 @@ fn main() -> Result<()> { let thread_termination_cvar = Arc::new(Condvar::new()); // Set up input handling - let (sender, receiver) = flume::unbounded(); + let (sender, receiver) = mpsc::channel(); let _input_thread = create_input_thread(sender.clone(), thread_termination_lock.clone()); // Cleaning loop @@ -106,7 +106,7 @@ fn main() -> Result<()> { }; // Event loop - let (collection_thread_ctrl_sender, collection_thread_ctrl_receiver) = flume::unbounded(); + let (collection_thread_ctrl_sender, collection_thread_ctrl_receiver) = mpsc::channel(); let _collection_thread = create_collection_thread( sender, collection_thread_ctrl_receiver, diff --git a/src/lib.rs b/src/lib.rs index 08b5c439..c6b220b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,10 @@ use std::{ panic::PanicInfo, path::PathBuf, sync::Mutex, - sync::{Arc, Condvar}, + sync::{ + mpsc::{Receiver, Sender}, + Arc, Condvar, + }, thread::{self, JoinHandle}, time::{Duration, Instant}, }; @@ -42,7 +45,6 @@ use crossterm::{ terminal::{disable_raw_mode, LeaveAlternateScreen}, }; use data_conversion::*; -use flume::{Receiver, Sender}; use options::*; use utils::error;