diff --git a/proxmox-sys/Cargo.toml b/proxmox-sys/Cargo.toml index 175c8910..f0fe0955 100644 --- a/proxmox-sys/Cargo.toml +++ b/proxmox-sys/Cargo.toml @@ -26,7 +26,6 @@ proxmox-sortable-macro = { path = "../proxmox-sortable-macro", optional = true, proxmox-io = { path = "../proxmox-io", version = "1.0.0" } proxmox-lang = { path = "../proxmox-lang", version = "1.1" } -proxmox-borrow = { path = "../proxmox-borrow", version = "1.0.0" } proxmox-time = { path = "../proxmox-time", version = "1.0.0" } [features] diff --git a/proxmox-sys/src/fs/read_dir.rs b/proxmox-sys/src/fs/read_dir.rs index 773baa06..5d223f37 100644 --- a/proxmox-sys/src/fs/read_dir.rs +++ b/proxmox-sys/src/fs/read_dir.rs @@ -10,8 +10,6 @@ use nix::sys::stat::Mode; use regex::Regex; -use proxmox_borrow::Tied; - #[cfg(feature = "timer")] use crate::error::SysError; @@ -89,7 +87,7 @@ impl ReadDirEntry { // This is simply a wrapper with a shorter type name mapping nix::Error to anyhow::Error. /// Wrapper over a pair of `nix::dir::Dir` and `nix::dir::Iter`, returned by `read_subdir()`. pub struct ReadDir { - iter: Tied> + Send>, + iter: nix::dir::OwningIter, dir_fd: RawFd, } @@ -112,10 +110,7 @@ impl Iterator for ReadDir { pub fn read_subdir(dirfd: RawFd, path: &P) -> nix::Result { let dir = Dir::openat(dirfd, path, OFlag::O_RDONLY, Mode::empty())?; let fd = dir.as_raw_fd(); - let iter = Tied::new(dir, |dir| { - Box::new(unsafe { (*dir).iter() }) - as Box> + Send> - }); + let iter = dir.into_iter(); Ok(ReadDir { iter, dir_fd: fd }) }