Skip to content

Commit

Permalink
Allow ?Sized in Box<_> and &mut TunnelStream usage
Browse files Browse the repository at this point in the history
This fixes Box<dyn TunnelStream> producing the following error message:
> the trait `Sized` is not implemented for `dyn TunnelStream + Unpin + std::marker::Send`
  • Loading branch information
Dessix committed Aug 26, 2021
1 parent 8baf04c commit 1b0ec41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snocat/src/util/tunnel_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub trait TunnelStream: AsyncRead + AsyncWrite + Send + Unpin {
}
}

impl<'stream, TInner: TunnelStream + 'stream> TunnelStream for &mut TInner {}
impl<'stream, TInner: TunnelStream + 'stream> TunnelStream for Box<TInner> {}
impl<'stream, TInner: TunnelStream + ?Sized + 'stream> TunnelStream for &'stream mut TInner {}
impl<TInner: TunnelStream + ?Sized> TunnelStream for Box<TInner> {}

pub struct QuinnTunnelRefStream<'a, TSession: quinn::crypto::Session>(
&'a mut quinn::generic::SendStream<TSession>,
Expand Down

0 comments on commit 1b0ec41

Please sign in to comment.