From 7380c48dffe79b3f9d182636cb52c529bf2e122b Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 6 Oct 2021 15:18:06 +0200 Subject: [PATCH] pbs-tools::io::pipe: use nix Error type there's no need to upgrade to anyhow::Error there already Signed-off-by: Wolfgang Bumiller --- pbs-tools/src/io.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pbs-tools/src/io.rs b/pbs-tools/src/io.rs index 13e1d9b7..1b5e3cc7 100644 --- a/pbs-tools/src/io.rs +++ b/pbs-tools/src/io.rs @@ -1,7 +1,5 @@ //! I/O utilities. -use anyhow::Error; - use proxmox::tools::fd::Fd; /// The `BufferedRead` trait provides a single function @@ -11,12 +9,12 @@ pub trait BufferedRead { /// This functions tries to fill the internal buffers, then /// returns a reference to the available data. It returns an empty /// buffer if `offset` points to the end of the file. - fn buffered_read(&mut self, offset: u64) -> Result<&[u8], Error>; + fn buffered_read(&mut self, offset: u64) -> Result<&[u8], anyhow::Error>; } /// safe wrapper for `nix::unistd::pipe2` defaulting to `O_CLOEXEC` and guarding the file /// descriptors. -pub fn pipe() -> Result<(Fd, Fd), Error> { +pub fn pipe() -> Result<(Fd, Fd), nix::Error> { let (pin, pout) = nix::unistd::pipe2(nix::fcntl::OFlag::O_CLOEXEC)?; Ok((Fd(pin), Fd(pout))) }