From b602b38c474e451889b504408e36e571960d5c15 Mon Sep 17 00:00:00 2001 From: Toshit Chawda Date: Thu, 26 Sep 2024 19:18:08 -0700 Subject: [PATCH] sink<&[u8]> is basically useless, don't accept --- wisp/src/stream.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wisp/src/stream.rs b/wisp/src/stream.rs index 1755db6..3f51d69 100644 --- a/wisp/src/stream.rs +++ b/wisp/src/stream.rs @@ -552,7 +552,7 @@ impl MuxStreamIoSink { } } -impl Sink<&[u8]> for MuxStreamIoSink { +impl Sink for MuxStreamIoSink { type Error = std::io::Error; fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { self.project() @@ -560,10 +560,10 @@ impl Sink<&[u8]> for MuxStreamIoSink { .poll_ready(cx) .map_err(std::io::Error::other) } - fn start_send(self: Pin<&mut Self>, item: &[u8]) -> Result<(), Self::Error> { + fn start_send(self: Pin<&mut Self>, item: BytesMut) -> Result<(), Self::Error> { self.project() .tx - .start_send(Payload::Bytes(BytesMut::from(item))) + .start_send(Payload::Bytes(item)) .map_err(std::io::Error::other) } fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> {