public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 2/2] proxmox-async: remove proxmox-sys dependency
Date: Fri, 18 Feb 2022 13:48:49 +0100	[thread overview]
Message-ID: <20220218124850.573252-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20220218124850.573252-1-d.csapak@proxmox.com>

by replacing the two uses of io_format_err and io_err_other

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 proxmox-async/Cargo.toml                     |  1 -
 proxmox-async/src/io/async_channel_writer.rs | 16 ++++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/proxmox-async/Cargo.toml b/proxmox-async/Cargo.toml
index c7f78cc..c4936ee 100644
--- a/proxmox-async/Cargo.toml
+++ b/proxmox-async/Cargo.toml
@@ -15,7 +15,6 @@ lazy_static = "1.4"
 pin-utils = "0.1.0"
 tokio = { version = "1.0", features = [ "net", "rt", "rt-multi-thread", "sync"] }
 
-proxmox-sys = { path = "../proxmox-sys", version = "0.2.0" }
 proxmox-io = { path = "../proxmox-io", version = "1", features = [ "tokio" ] }
 
 [dev-dependencies]
diff --git a/proxmox-async/src/io/async_channel_writer.rs b/proxmox-async/src/io/async_channel_writer.rs
index f63648a..cec1fb6 100644
--- a/proxmox-async/src/io/async_channel_writer.rs
+++ b/proxmox-async/src/io/async_channel_writer.rs
@@ -12,8 +12,6 @@ use tokio::io::AsyncWrite;
 use tokio::sync::mpsc::Sender;
 
 use proxmox_io::ByteBuffer;
-use proxmox_sys::error::io_err_other;
-use proxmox_sys::io_format_err;
 
 /// Wrapper around tokio::sync::mpsc::Sender, which implements Write
 pub struct AsyncChannelWriter {
@@ -63,7 +61,12 @@ impl AsyncChannelWriter {
 
                     let sender = match self.sender.take() {
                         Some(sender) => sender,
-                        None => return Poll::Ready(Err(io_err_other("no sender"))),
+                        None => {
+                            return Poll::Ready(Err(std::io::Error::new(
+                                std::io::ErrorKind::Other,
+                                "no sender",
+                            )))
+                        }
                     };
 
                     let data = self.buf.remove_data(self.buf.len()).to_vec();
@@ -72,7 +75,12 @@ impl AsyncChannelWriter {
                             .send(Ok(data))
                             .await
                             .map(move |_| sender)
-                            .map_err(|err| io_format_err!("could not send: {}", err))
+                            .map_err(|err| {
+                                std::io::Error::new(
+                                    std::io::ErrorKind::Other,
+                                    format!("could not send: {}", err),
+                                )
+                            })
                     };
 
                     self.state = WriterState::Sending(future.boxed());
-- 
2.30.2





  parent reply	other threads:[~2022-02-18 12:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 12:48 [pbs-devel] [PATCH proxmox/proxmox-backup] improve proxmox-async dependencies Dominik Csapak
2022-02-18 12:48 ` [pbs-devel] [PATCH proxmox 1/2] split out compression code into new crate 'proxmox-compression' Dominik Csapak
2022-02-18 12:48 ` Dominik Csapak [this message]
2022-02-18 12:48 ` [pbs-devel] [PATCH proxmox-backup 1/1] depend on new 'proxmox-compression' crate Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220218124850.573252-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal