From 63499747b9380a85ebb7ebf2315ac2fc7116cf1f Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 23 Jun 2022 14:25:42 -0400 Subject: [PATCH] Bump to cap-std 0.25 and io-lifetimes 0.7 Prep for bumping ostree-rs-ext, which will help bump rpm-ostree, which will get it out of having two copies of rustix. --- Cargo.toml | 6 +++--- rust-bindings/src/repo.rs | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f4544b39..4b865f2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,8 +38,8 @@ members = [".", "rust-bindings/sys"] [dependencies] bitflags = "1.2.1" -cap-std = { version = "0.24", optional = true} -io-lifetimes = { version = "0.5", optional = true} +cap-std = { version = "0.25", optional = true} +io-lifetimes = { version = "0.7", optional = true} ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.10.0" } gio = "0.14" glib = "0.14.4" @@ -53,7 +53,7 @@ thiserror = "1.0.20" maplit = "1.0.2" openat = "0.1.19" tempfile = "3" -cap-tempfile = "0.24" +cap-tempfile = "0.25" [features] cap-std-apis = ["cap-std", "io-lifetimes", "v2017_10"] diff --git a/rust-bindings/src/repo.rs b/rust-bindings/src/repo.rs index a8ddbca1..6947f49b 100644 --- a/rust-bindings/src/repo.rs +++ b/rust-bindings/src/repo.rs @@ -154,13 +154,15 @@ impl Repo { /// Borrow the directory file descriptor for this repository. #[cfg(feature = "cap-std-apis")] pub fn dfd_borrow(&self) -> io_lifetimes::BorrowedFd { - unsafe { io_lifetimes::BorrowedFd::borrow_raw_fd(self.dfd()) } + unsafe { io_lifetimes::BorrowedFd::borrow_raw(self.dfd()) } } /// Return a new `cap-std` directory reference for this repository. #[cfg(feature = "cap-std-apis")] pub fn dfd_as_dir(&self) -> std::io::Result { - cap_std::fs::Dir::reopen_dir(&self.dfd_borrow()) + use io_lifetimes::AsFd; + let dfd = self.dfd_borrow(); + cap_std::fs::Dir::reopen_dir(&dfd.as_fd()) } /// Find all objects reachable from a commit.