refactor(proto): replace anyhow with thiserror in writers
This commit is contained in:
parent
bb39d138d8
commit
58c69928a1
5 changed files with 21 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use async_trait::async_trait;
|
||||
use tokio::io;
|
||||
use tokio::io::{AsyncWrite, AsyncWriteExt};
|
||||
|
||||
pub struct ProtoWriter<W>
|
||||
|
|
@ -19,7 +20,7 @@ where
|
|||
|
||||
#[async_trait]
|
||||
pub trait ProtoFlush {
|
||||
async fn flush(&mut self) -> anyhow::Result<()>;
|
||||
async fn flush(&mut self) -> Result<(), io::Error>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
|
@ -27,7 +28,7 @@ impl<W> ProtoFlush for ProtoWriter<W>
|
|||
where
|
||||
W: AsyncWrite + Unpin + Send,
|
||||
{
|
||||
async fn flush(&mut self) -> anyhow::Result<()> {
|
||||
async fn flush(&mut self) -> Result<(), io::Error> {
|
||||
self.inner.flush().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue