diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-02-22 17:02:12 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-02-23 02:44:18 -0500 |
commit | 39287b07f87aba15c4cb0f64d7008ba67289151d (patch) | |
tree | a0ce5fee6e98a7c429f668000d7cdc71cf8d4797 /src/error.rs | |
parent | ebcf5f15081f6a84c861eb2aecbf962396a88695 (diff) | |
download | pty-process-39287b07f87aba15c4cb0f64d7008ba67289151d.tar.gz pty-process-39287b07f87aba15c4cb0f64d7008ba67289151d.zip |
another rewrite
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 9d4c31e..db9c647 100644 --- a/src/error.rs +++ b/src/error.rs @@ -5,6 +5,9 @@ pub enum Error { Io(std::io::Error), /// error came from nix::Error Nix(nix::Error), + /// unsplit was called on halves of two different ptys + #[cfg(feature = "async")] + Unsplit(crate::OwnedReadPty, crate::OwnedWritePty), } impl std::fmt::Display for Error { @@ -12,6 +15,10 @@ impl std::fmt::Display for Error { match self { Self::Io(e) => write!(f, "{}", e), Self::Nix(e) => write!(f, "{}", e), + #[cfg(feature = "async")] + Self::Unsplit(..) => { + write!(f, "unsplit called on halves of two different ptys") + } } } } @@ -33,6 +40,8 @@ impl std::error::Error for Error { match self { Self::Io(e) => Some(e), Self::Nix(e) => Some(e), + #[cfg(feature = "async")] + Self::Unsplit(..) => None, } } } |