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.
This commit is contained in:
Colin Walters 2022-06-23 14:25:42 -04:00
parent b87c8a8e23
commit 63499747b9
2 changed files with 7 additions and 5 deletions

View File

@ -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"]

View File

@ -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> {
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.