From 375d8aa62bf7ff801eed992741d1d3f781328c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Sun, 20 Sep 2020 01:41:00 +0200 Subject: [PATCH] silence some warnings about unchecked Result/Err alternatively I should find a way to propagate the errors back to the writter --- src/threaded_archiver.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/threaded_archiver.rs b/src/threaded_archiver.rs index 7902729..88af807 100644 --- a/src/threaded_archiver.rs +++ b/src/threaded_archiver.rs @@ -40,17 +40,17 @@ impl StreamWriter { impl io::Write for StreamWriter { fn write(&mut self, data: &[u8]) -> io::Result { let len = data.len(); - futures::executor::block_on( - async move { - let buf = bytes::Bytes::copy_from_slice(data); - self.tx.send(buf).await; - } - ); + futures::executor::block_on(async move { + let buf = bytes::Bytes::copy_from_slice(data); + self.tx.send(buf).await.ok(); // maybe propagate any errors back + }); Ok(len) } fn flush(&mut self) -> io::Result<()> { - futures::executor::block_on(self.tx.flush()); + futures::executor::block_on(async move { + self.tx.flush().await.ok() + }); Ok(()) } }