From f7e3f34adfbe3a9ff2adb92fe094ef9dff4c5dbb Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 13 Dec 2021 02:57:05 -0500 Subject: this is actually pretty unnecessary --- src/main.rs | 1 - src/state/history.rs | 9 +++++---- src/util.rs | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 src/util.rs (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 22af8ca..da1facf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,6 @@ mod event; mod format; mod parse; mod state; -mod util; use async_std::stream::StreamExt as _; use textmode::Textmode as _; diff --git a/src/state/history.rs b/src/state/history.rs index 048c1c7..be61423 100644 --- a/src/state/history.rs +++ b/src/state/history.rs @@ -5,7 +5,7 @@ use std::os::unix::process::ExitStatusExt as _; pub struct History { size: (u16, u16), - entries: Vec>, + entries: Vec>>, scroll_pos: usize, } @@ -87,8 +87,9 @@ impl History { let (exe, args) = crate::parse::cmd(cmd); let (input_w, input_r) = async_std::channel::unbounded(); let (resize_w, resize_r) = async_std::channel::unbounded(); - let entry = - crate::util::mutex(Entry::new(cmd, self.size, input_w, resize_w)); + let entry = async_std::sync::Arc::new(async_std::sync::Mutex::new( + Entry::new(cmd, self.size, input_w, resize_w), + )); if crate::builtins::is(&exe) { let code: i32 = crate::builtins::run(&exe, &args).into(); entry.lock_arc().await.exit_info = Some(ExitInfo::new( @@ -492,7 +493,7 @@ impl ExitInfo { fn run_process( mut child: pty_process::async_std::Child, - entry: crate::util::Mutex, + entry: async_std::sync::Arc>, input_r: async_std::channel::Receiver>, resize_r: async_std::channel::Receiver<(u16, u16)>, event_w: async_std::channel::Sender, diff --git a/src/util.rs b/src/util.rs deleted file mode 100644 index d792b91..0000000 --- a/src/util.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub type Mutex = async_std::sync::Arc>; - -pub fn mutex(t: T) -> Mutex { - async_std::sync::Arc::new(async_std::sync::Mutex::new(t)) -} -- cgit v1.2.3-54-g00ecf