Skip to content

Commit

Permalink
Fix one more place that was depending on std::os::unix::fs::Permissio…
Browse files Browse the repository at this point in the history
…nsExt (#345)
  • Loading branch information
sunfishcode committed Jan 11, 2024
1 parent 6849a94 commit e3f9875
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cap-primitives/src/fs/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ impl Permissions {
#[allow(clippy::unnecessary_wraps)]
fn _into_std(self, _file: &fs::File) -> io::Result<fs::Permissions> {
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")]
Expand Down Expand Up @@ -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),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cap-primitives/src/rustix/fs/permissions_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e3f9875

Please sign in to comment.