Fix resources
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ impl PtyMaster {
|
||||
}
|
||||
|
||||
impl Resource for PtyMaster {
|
||||
fn boxed_clone(&self) -> Box<Resource> {
|
||||
fn boxed_clone(&self) -> Box<dyn Resource> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ impl PtyPgrp {
|
||||
}
|
||||
|
||||
impl Resource for PtyPgrp {
|
||||
fn boxed_clone(&self) -> Box<Resource> {
|
||||
fn boxed_clone(&self) -> Box<dyn Resource> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use syscall::error::Result;
|
||||
use pty::Pty;
|
||||
|
||||
pub trait Resource {
|
||||
fn boxed_clone(&self) -> Box<Resource>;
|
||||
fn boxed_clone(&self) -> Box<dyn Resource>;
|
||||
fn pty(&self) -> Weak<RefCell<Pty>>;
|
||||
fn flags(&self) -> usize;
|
||||
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ use winsize::PtyWinsize;
|
||||
|
||||
pub struct PtyScheme {
|
||||
next_id: usize,
|
||||
pub handles: BTreeMap<usize, Box<Resource>>,
|
||||
pub handles: BTreeMap<usize, Box<dyn Resource>>,
|
||||
}
|
||||
|
||||
impl PtyScheme {
|
||||
@@ -59,7 +59,7 @@ impl SchemeBlockMut for PtyScheme {
|
||||
}
|
||||
|
||||
fn dup(&mut self, old_id: usize, buf: &[u8]) -> Result<Option<usize>> {
|
||||
let handle: Box<Resource> = {
|
||||
let handle: Box<dyn Resource> = {
|
||||
let old_handle = self.handles.get(&old_id).ok_or(Error::new(EBADF))?;
|
||||
|
||||
if buf.is_empty() {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ impl PtySlave {
|
||||
}
|
||||
|
||||
impl Resource for PtySlave {
|
||||
fn boxed_clone(&self) -> Box<Resource> {
|
||||
fn boxed_clone(&self) -> Box<dyn Resource> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ impl PtyTermios {
|
||||
}
|
||||
|
||||
impl Resource for PtyTermios {
|
||||
fn boxed_clone(&self) -> Box<Resource> {
|
||||
fn boxed_clone(&self) -> Box<dyn Resource> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ impl PtyWinsize {
|
||||
}
|
||||
|
||||
impl Resource for PtyWinsize {
|
||||
fn boxed_clone(&self) -> Box<Resource> {
|
||||
fn boxed_clone(&self) -> Box<dyn Resource> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user