diff --git a/async/src/async_channel.rs b/async/src/async_channel.rs index 6306d599..4db80865 100644 --- a/async/src/async_channel.rs +++ b/async/src/async_channel.rs @@ -113,7 +113,7 @@ impl Write for ChanIO<'_> { /// Otherwise ordering will be arbitrary, and if competing readers or writers /// are in different tasks, there will be churn as they continually wake /// each other up. Simultaneous single-reader and single-writer is fine. -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct ChanIn<'g>(ChanIO<'g>); impl<'g> ChanIn<'g> { @@ -134,6 +134,12 @@ impl Drop for ChanIn<'_> { } } +impl Clone for ChanIn<'_> { + fn clone(&self) -> Self { + Self::new(self.0.clone()) + } +} + /// An output-only SSH channel. /// /// This is used as stderr for a server, or can also be obtained using @@ -187,7 +193,7 @@ impl<'g> ChanOut<'g> { /// Otherwise ordering will be arbitrary, and if competing readers or writers /// are in different tasks, there will be churn as they continually wake /// each other up. Simultaneous single-reader and single-writer is fine. -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct ChanInOut<'g>(ChanIO<'g>); impl<'g> ChanInOut<'g> { @@ -225,6 +231,12 @@ impl Drop for ChanInOut<'_> { } } +impl Clone for ChanInOut<'_> { + fn clone(&self) -> Self { + Self::new(self.0.clone()) + } +} + impl ErrorType for ChanInOut<'_> { type Error = sunset::Error; }