silence some warnings about unchecked Result/Err
alternatively I should find a way to propagate the errors back to the writter
This commit is contained in:
parent
d33810da52
commit
375d8aa62b
1 changed files with 7 additions and 7 deletions
|
@ -40,17 +40,17 @@ impl StreamWriter {
|
|||
impl io::Write for StreamWriter {
|
||||
fn write(&mut self, data: &[u8]) -> io::Result<usize> {
|
||||
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(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue