From fcbdfacd72303c48f69cbde1ad5c343274c05fbf Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 4 Mar 2022 20:36:16 -0500 Subject: cleanup --- src/shell/history/pty.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/shell/history/pty.rs b/src/shell/history/pty.rs index 91b9cbb..0348d75 100644 --- a/src/shell/history/pty.rs +++ b/src/shell/history/pty.rs @@ -7,7 +7,7 @@ enum Request { } pub struct Pty { - vt: std::sync::Arc>, + vt: std::sync::Arc>, request_w: tokio::sync::mpsc::UnboundedSender, } @@ -22,9 +22,7 @@ impl Pty { pty.resize(pty_process::Size::new(size.0, size.1))?; let pts = pty.pts()?; - let vt = std::sync::Arc::new(std::sync::Mutex::new( - super::pty::Vt::new(size), - )); + let vt = std::sync::Arc::new(std::sync::Mutex::new(Vt::new(size))); tokio::spawn(Self::task( pty, @@ -36,20 +34,17 @@ impl Pty { Ok((Self { vt, request_w }, pts)) } - pub fn with_vt(&self, f: impl FnOnce(&super::pty::Vt) -> T) -> T { + pub fn with_vt(&self, f: impl FnOnce(&Vt) -> T) -> T { let vt = self.vt.lock().unwrap(); f(&*vt) } - pub fn with_vt_mut( - &self, - f: impl FnOnce(&mut super::pty::Vt) -> T, - ) -> T { + pub fn with_vt_mut(&self, f: impl FnOnce(&mut Vt) -> T) -> T { let mut vt = self.vt.lock().unwrap(); f(&mut *vt) } - pub fn lock_vt(&self) -> std::sync::MutexGuard { + pub fn lock_vt(&self) -> std::sync::MutexGuard { self.vt.lock().unwrap() } @@ -69,7 +64,7 @@ impl Pty { async fn task( pty: pty_process::Pty, - vt: std::sync::Arc>, + vt: std::sync::Arc>, request_r: tokio::sync::mpsc::UnboundedReceiver, event_w: crate::shell::event::Writer, ) { -- cgit v1.2.3-54-g00ecf