Use From instead of custom ReclaimStream.
This commit is contained in:
committed by
Martin Algesten
parent
af6491cd59
commit
069775d3e0
@@ -120,23 +120,13 @@ impl Read for Stream {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "tls", not(feature = "native-tls")))]
|
||||
pub(crate) trait ReclaimStream {
|
||||
fn reclaim_stream(self) -> Stream;
|
||||
}
|
||||
|
||||
impl ReclaimStream for Stream {
|
||||
fn reclaim_stream(self) -> Stream {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<R: ReclaimStream> ReclaimStream for ChunkDecoder<R>
|
||||
impl<R> From<ChunkDecoder<R>> for Stream
|
||||
where
|
||||
R: Read,
|
||||
Stream: From<R>,
|
||||
{
|
||||
fn reclaim_stream(self) -> Stream {
|
||||
self.into_inner().reclaim_stream()
|
||||
fn from(chunk_decoder: ChunkDecoder<R>) -> Stream {
|
||||
chunk_decoder.into_inner().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user