diff --git a/pbs-tools/src/sync/std_channel_writer.rs b/pbs-tools/src/sync/std_channel_writer.rs index eb217059..c5131a12 100644 --- a/pbs-tools/src/sync/std_channel_writer.rs +++ b/pbs-tools/src/sync/std_channel_writer.rs @@ -1,24 +1,23 @@ use std::io::Write; use std::sync::mpsc::SyncSender; - -use anyhow::{Error}; +use std::string::ToString; /// Wrapper around SyncSender, which implements Write /// /// Each write in translated into a send(Vec). -pub struct StdChannelWriter(SyncSender, Error>>); +pub struct StdChannelWriter(SyncSender, E>>); -impl StdChannelWriter { - pub fn new(sender: SyncSender, Error>>) -> Self { +impl StdChannelWriter { + pub fn new(sender: SyncSender, E>>) -> Self { Self(sender) } } -impl Write for StdChannelWriter { +impl Write for StdChannelWriter { fn write(&mut self, buf: &[u8]) -> Result { self.0 .send(Ok(buf.to_vec())) - .map_err(proxmox_sys::error::io_err_other) + .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err.to_string())) .and(Ok(buf.len())) }