From 39287b07f87aba15c4cb0f64d7008ba67289151d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 22 Feb 2022 17:02:12 -0500 Subject: another rewrite --- src/error.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/error.rs') 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, } } } -- cgit v1.2.3-54-g00ecf