aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/command.rs6
-rw-r--r--src/command/async_process.rs6
-rw-r--r--src/command/std.rs6
-rw-r--r--src/command/tokio.rs6
4 files changed, 16 insertions, 8 deletions
diff --git a/src/command.rs b/src/command.rs
index ca7e4e3..a5df5ed 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -9,11 +9,13 @@ mod async_process;
#[cfg(feature = "tokio")]
mod tokio;
-pub trait Command<T> {
+pub trait Command {
+ type Child;
+
fn spawn_pty(
&mut self,
size: Option<&crate::pty::Size>,
- ) -> Result<Child<T>>;
+ ) -> Result<Child<Self::Child>>;
}
pub struct Child<T> {
diff --git a/src/command/async_process.rs b/src/command/async_process.rs
index c712289..687fbe4 100644
--- a/src/command/async_process.rs
+++ b/src/command/async_process.rs
@@ -3,11 +3,13 @@ use crate::error::*;
use async_process::unix::CommandExt as _;
use std::os::unix::io::{AsRawFd as _, FromRawFd as _};
-impl super::Command<async_process::Child> for async_process::Command {
+impl super::Command for async_process::Command {
+ type Child = async_process::Child;
+
fn spawn_pty(
&mut self,
size: Option<&crate::pty::Size>,
- ) -> Result<super::Child<async_process::Child>> {
+ ) -> Result<super::Child<Self::Child>> {
let (pty, pts, stdin, stdout, stderr) = super::setup_pty(size)?;
let pt_fd = pty.pt().as_raw_fd();
diff --git a/src/command/std.rs b/src/command/std.rs
index d544b83..0f3bef1 100644
--- a/src/command/std.rs
+++ b/src/command/std.rs
@@ -3,11 +3,13 @@ use crate::error::*;
use std::os::unix::io::{AsRawFd as _, FromRawFd as _};
use std::os::unix::process::CommandExt as _;
-impl super::Command<std::process::Child> for std::process::Command {
+impl super::Command for std::process::Command {
+ type Child = std::process::Child;
+
fn spawn_pty(
&mut self,
size: Option<&crate::pty::Size>,
- ) -> Result<super::Child<std::process::Child>> {
+ ) -> Result<super::Child<Self::Child>> {
let (pty, pts, stdin, stdout, stderr) = super::setup_pty(size)?;
let pt_fd = pty.pt().as_raw_fd();
diff --git a/src/command/tokio.rs b/src/command/tokio.rs
index f29c247..54bfefb 100644
--- a/src/command/tokio.rs
+++ b/src/command/tokio.rs
@@ -2,11 +2,13 @@ use crate::error::*;
use std::os::unix::io::{AsRawFd as _, FromRawFd as _};
-impl super::Command<tokio::process::Child> for tokio::process::Command {
+impl super::Command for tokio::process::Command {
+ type Child = tokio::process::Child;
+
fn spawn_pty(
&mut self,
size: Option<&crate::pty::Size>,
- ) -> Result<super::Child<tokio::process::Child>> {
+ ) -> Result<super::Child<Self::Child>> {
let (pty, pts, stdin, stdout, stderr) = super::setup_pty(size)?;
let pt_fd = pty.pt().as_raw_fd();