From a2462bbaea13f7a3f3eb65e7430b30618bc203b8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 25 Feb 2022 17:32:58 -0500 Subject: move to tokio --- src/shell/history/entry.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/shell/history/entry.rs') diff --git a/src/shell/history/entry.rs b/src/shell/history/entry.rs index a45d99d..97e8a7b 100644 --- a/src/shell/history/entry.rs +++ b/src/shell/history/entry.rs @@ -16,8 +16,8 @@ pub struct Entry { visual_bell: bool, real_bell_pending: bool, fullscreen: Option, - input: async_std::channel::Sender>, - resize: async_std::channel::Sender<(u16, u16)>, + input: tokio::sync::mpsc::UnboundedSender>, + resize: tokio::sync::mpsc::UnboundedSender<(u16, u16)>, start_time: time::OffsetDateTime, start_instant: std::time::Instant, } @@ -27,8 +27,8 @@ impl Entry { cmdline: String, env: Env, size: (u16, u16), - input: async_std::channel::Sender>, - resize: async_std::channel::Sender<(u16, u16)>, + input: tokio::sync::mpsc::UnboundedSender>, + resize: tokio::sync::mpsc::UnboundedSender<(u16, u16)>, ) -> Self { let span = (0, cmdline.len()); Self { @@ -229,13 +229,13 @@ impl Entry { pub async fn send_input(&self, bytes: Vec) { if self.running() { - self.input.send(bytes).await.unwrap(); + self.input.send(bytes).unwrap(); } } pub async fn resize(&mut self, size: (u16, u16)) { if self.running() { - self.resize.send(size).await.unwrap(); + self.resize.send(size).unwrap(); self.vt.set_size(size.0, size.1); } } @@ -341,11 +341,11 @@ impl Entry { pub async fn finish( &mut self, env: Env, - event_w: async_std::channel::Sender, + event_w: tokio::sync::mpsc::UnboundedSender, ) { self.state = State::Exited(ExitInfo::new(env.latest_status())); self.env = env; - event_w.send(Event::PtyClose).await.unwrap(); + event_w.send(Event::PtyClose).unwrap(); } fn exit_info(&self) -> Option<&ExitInfo> { @@ -369,12 +369,12 @@ impl Entry { } struct ExitInfo { - status: async_std::process::ExitStatus, + status: std::process::ExitStatus, instant: std::time::Instant, } impl ExitInfo { - fn new(status: async_std::process::ExitStatus) -> Self { + fn new(status: std::process::ExitStatus) -> Self { Self { status, instant: std::time::Instant::now(), -- cgit v1.2.3-54-g00ecf