From 3f325047dcc2eadd0fb9d9584d5cc684eda35d8e Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 26 Jul 2024 12:17:09 +0200 Subject: [PATCH] remove use of proxmox_lang::error::io_err_other by now its functionality is provided by std::io::Error::other Signed-off-by: Wolfgang Bumiller --- pbs-datastore/src/cached_chunk_reader.rs | 3 +-- src/tools/disks/mod.rs | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pbs-datastore/src/cached_chunk_reader.rs b/pbs-datastore/src/cached_chunk_reader.rs index cdb42bb9b..be7f2a1e2 100644 --- a/pbs-datastore/src/cached_chunk_reader.rs +++ b/pbs-datastore/src/cached_chunk_reader.rs @@ -10,7 +10,6 @@ use anyhow::Error; use futures::ready; use tokio::io::{AsyncRead, AsyncSeek, ReadBuf}; -use proxmox_lang::error::io_err_other; use proxmox_lang::io_format_err; use pbs_tools::async_lru_cache::{AsyncCacher, AsyncLruCache}; @@ -182,7 +181,7 @@ where this.position += read as u64; Ok(()) } - Err(err) => Err(io_err_other(err)), + Err(err) => Err(std::io::Error::other(err)), }; // future completed, drop diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs index 0d2aa2c5b..9b5aaf6bf 100644 --- a/src/tools/disks/mod.rs +++ b/src/tools/disks/mod.rs @@ -14,7 +14,6 @@ use once_cell::sync::OnceCell; use ::serde::{Deserialize, Serialize}; -use proxmox_lang::error::io_err_other; use proxmox_lang::{io_bail, io_format_err}; use proxmox_schema::api; use proxmox_sys::linux::procfs::{mountinfo::Device, MountInfo}; @@ -300,7 +299,7 @@ impl Disk { /// Convenience wrapper for reading a `/sys` file which contains just a simple utf-8 string. pub fn read_sys_str>(&self, path: P) -> io::Result> { Ok(match self.read_sys(path.as_ref())? { - Some(data) => Some(String::from_utf8(data).map_err(io_err_other)?), + Some(data) => Some(String::from_utf8(data).map_err(io::Error::other)?), None => None, }) } @@ -308,7 +307,7 @@ impl Disk { /// Convenience wrapper for unsigned integer `/sys` values up to 64 bit. pub fn read_sys_u64>(&self, path: P) -> io::Result> { Ok(match self.read_sys_str(path)? { - Some(data) => Some(data.trim().parse().map_err(io_err_other)?), + Some(data) => Some(data.trim().parse().map_err(io::Error::other)?), None => None, }) }