From 613a00220eacc3bf55dcbd3417c80ba80a0fd56a Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Jan 2024 15:21:25 -0800 Subject: [PATCH] Fix one more place that was depending on std::os::unix::fs::PermissionsExt --- cap-primitives/src/fs/permissions.rs | 10 ++++++---- cap-primitives/src/rustix/fs/permissions_ext.rs | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cap-primitives/src/fs/permissions.rs b/cap-primitives/src/fs/permissions.rs index eefaae66..f20c36fc 100644 --- a/cap-primitives/src/fs/permissions.rs +++ b/cap-primitives/src/fs/permissions.rs @@ -49,7 +49,9 @@ impl Permissions { #[allow(clippy::unnecessary_wraps)] fn _into_std(self, _file: &fs::File) -> io::Result { use std::os::unix::fs::PermissionsExt; - Ok(fs::Permissions::from_mode(self.ext.mode())) + Ok(fs::Permissions::from_mode(crate::fs::PermissionsExt::mode( + &self.ext, + ))) } #[cfg(target_os = "wasi")] @@ -109,19 +111,19 @@ pub trait PermissionsExt { impl PermissionsExt for Permissions { #[inline] fn mode(&self) -> u32 { - std::os::unix::fs::PermissionsExt::mode(&self.ext) + crate::fs::PermissionsExt::mode(&self.ext) } #[inline] fn set_mode(&mut self, mode: u32) { - std::os::unix::fs::PermissionsExt::set_mode(&mut self.ext, mode) + crate::fs::PermissionsExt::set_mode(&mut self.ext, mode) } #[inline] fn from_mode(mode: u32) -> Self { Self { readonly: ImplPermissionsExt::readonly(mode as RawMode), - ext: std::os::unix::fs::PermissionsExt::from_mode(mode), + ext: crate::fs::PermissionsExt::from_mode(mode), } } } diff --git a/cap-primitives/src/rustix/fs/permissions_ext.rs b/cap-primitives/src/rustix/fs/permissions_ext.rs index 4b6e04b4..fef1cb44 100644 --- a/cap-primitives/src/rustix/fs/permissions_ext.rs +++ b/cap-primitives/src/rustix/fs/permissions_ext.rs @@ -50,7 +50,7 @@ impl ImplPermissionsExt { } #[cfg(not(target_os = "wasi"))] -impl std::os::unix::fs::PermissionsExt for ImplPermissionsExt { +impl crate::fs::PermissionsExt for ImplPermissionsExt { fn mode(&self) -> u32 { self.mode as u32 }