From 1a98063bd9a3876cc699bb22fa8c1a1bda02ef3d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 26 Jul 2024 13:07:34 +0200 Subject: [PATCH] drop io_err_other in favor of std::io::Error::other Signed-off-by: Wolfgang Bumiller --- src/error.rs | 5 ----- src/main.rs | 1 - src/process/pid_fd.rs | 5 ++--- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 src/error.rs diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index a5d87b6..0000000 --- a/src/error.rs +++ /dev/null @@ -1,5 +0,0 @@ -use std::io; - -pub fn io_err_other(e: E) -> io::Error { - io::Error::new(io::ErrorKind::Other, e.to_string()) -} diff --git a/src/main.rs b/src/main.rs index efd15ef..3fa1155 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,6 @@ mod macros; pub mod apparmor; pub mod capability; pub mod client; -pub mod error; pub mod fork; pub mod io; pub mod lxcseccomp; diff --git a/src/process/pid_fd.rs b/src/process/pid_fd.rs index c684e18..9dd5859 100644 --- a/src/process/pid_fd.rs +++ b/src/process/pid_fd.rs @@ -10,7 +10,6 @@ use anyhow::{bail, Error}; use libc::pid_t; use crate::capability::Capabilities; -use crate::error::io_err_other; use crate::nsfd::{ns_type, NsFd}; use super::{CGroups, IdMap, IdMapEntry, ProcStatus, Uids, UserCaps}; @@ -153,7 +152,7 @@ impl PidFd { })?, 16, ) - .map_err(io_err_other) + .map_err(io::Error::other) } #[inline] @@ -164,7 +163,7 @@ impl PidFd { })?, 8, ) - .map_err(io_err_other) + .map_err(io::Error::other) } let mut ids = Uids::default();