From ce1d87e2aa982eb5378f5310ae023d16381b1567 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 28 Jan 2020 10:57:23 -0700 Subject: [PATCH] Fix resources --- src/master.rs | 2 +- src/pgrp.rs | 2 +- src/resource.rs | 2 +- src/scheme.rs | 4 ++-- src/slave.rs | 2 +- src/termios.rs | 2 +- src/winsize.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/master.rs b/src/master.rs index 19b0545e2f..65db561a96 100644 --- a/src/master.rs +++ b/src/master.rs @@ -28,7 +28,7 @@ impl PtyMaster { } impl Resource for PtyMaster { - fn boxed_clone(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(self.clone()) } diff --git a/src/pgrp.rs b/src/pgrp.rs index df9f96b60e..f79c256cf5 100644 --- a/src/pgrp.rs +++ b/src/pgrp.rs @@ -25,7 +25,7 @@ impl PtyPgrp { } impl Resource for PtyPgrp { - fn boxed_clone(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(self.clone()) } diff --git a/src/resource.rs b/src/resource.rs index ded96d56be..39a24561f3 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -6,7 +6,7 @@ use syscall::error::Result; use pty::Pty; pub trait Resource { - fn boxed_clone(&self) -> Box; + fn boxed_clone(&self) -> Box; fn pty(&self) -> Weak>; fn flags(&self) -> usize; diff --git a/src/scheme.rs b/src/scheme.rs index 43dcf6abf6..3e5c929f41 100644 --- a/src/scheme.rs +++ b/src/scheme.rs @@ -18,7 +18,7 @@ use winsize::PtyWinsize; pub struct PtyScheme { next_id: usize, - pub handles: BTreeMap>, + pub handles: BTreeMap>, } impl PtyScheme { @@ -59,7 +59,7 @@ impl SchemeBlockMut for PtyScheme { } fn dup(&mut self, old_id: usize, buf: &[u8]) -> Result> { - let handle: Box = { + let handle: Box = { let old_handle = self.handles.get(&old_id).ok_or(Error::new(EBADF))?; if buf.is_empty() { diff --git a/src/slave.rs b/src/slave.rs index f6dc6fe7a5..a7232a34ee 100644 --- a/src/slave.rs +++ b/src/slave.rs @@ -28,7 +28,7 @@ impl PtySlave { } impl Resource for PtySlave { - fn boxed_clone(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(self.clone()) } diff --git a/src/termios.rs b/src/termios.rs index 807e09206e..c6ea14b4a9 100644 --- a/src/termios.rs +++ b/src/termios.rs @@ -25,7 +25,7 @@ impl PtyTermios { } impl Resource for PtyTermios { - fn boxed_clone(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(self.clone()) } diff --git a/src/winsize.rs b/src/winsize.rs index 2c34584e62..c0480a57f6 100644 --- a/src/winsize.rs +++ b/src/winsize.rs @@ -25,7 +25,7 @@ impl PtyWinsize { } impl Resource for PtyWinsize { - fn boxed_clone(&self) -> Box { + fn boxed_clone(&self) -> Box { Box::new(self.clone()) }