From df9c53b20d056d8d81e37244dc2bbe1f5cc24175 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sat, 17 Dec 2022 12:02:38 -0500 Subject: [PATCH] Use crossbeam for message passing --- Cargo.lock | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/command.rs | 1 - 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1d32918..621b2a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,6 +90,73 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "crossterm" version = "0.25.0" @@ -228,6 +295,7 @@ dependencies = [ "ansi4tui", "anyhow", "atty", + "crossbeam", "crossterm", "shellwords", "tui", @@ -264,6 +332,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "mio" version = "0.8.5" diff --git a/Cargo.toml b/Cargo.toml index b0d2dbd..f7c76c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,3 +12,4 @@ atty = "0.2.14" ansi4tui = {path = "./ansi4tui/"} anyhow = "1.0.66" shellwords = "1.1.0" +crossbeam = "0.8.2" diff --git a/src/command.rs b/src/command.rs index ae60560..c10eab3 100644 --- a/src/command.rs +++ b/src/command.rs @@ -55,7 +55,6 @@ pub fn run(app: &mut App) { } } Err(e) => { - println!("asdf"); app.command_result.status_success = false; app.command_result.stderr = e.to_string().as_bytes().to_vec(); }