Skip to content

Commit e3f9875

Browse files
authored
Fix one more place that was depending on std::os::unix::fs::PermissionsExt (#345)
1 parent 6849a94 commit e3f9875

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

cap-primitives/src/fs/permissions.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ impl Permissions {
4949
#[allow(clippy::unnecessary_wraps)]
5050
fn _into_std(self, _file: &fs::File) -> io::Result<fs::Permissions> {
5151
use std::os::unix::fs::PermissionsExt;
52-
Ok(fs::Permissions::from_mode(self.ext.mode()))
52+
Ok(fs::Permissions::from_mode(crate::fs::PermissionsExt::mode(
53+
&self.ext,
54+
)))
5355
}
5456

5557
#[cfg(target_os = "wasi")]
@@ -109,19 +111,19 @@ pub trait PermissionsExt {
109111
impl PermissionsExt for Permissions {
110112
#[inline]
111113
fn mode(&self) -> u32 {
112-
std::os::unix::fs::PermissionsExt::mode(&self.ext)
114+
crate::fs::PermissionsExt::mode(&self.ext)
113115
}
114116

115117
#[inline]
116118
fn set_mode(&mut self, mode: u32) {
117-
std::os::unix::fs::PermissionsExt::set_mode(&mut self.ext, mode)
119+
crate::fs::PermissionsExt::set_mode(&mut self.ext, mode)
118120
}
119121

120122
#[inline]
121123
fn from_mode(mode: u32) -> Self {
122124
Self {
123125
readonly: ImplPermissionsExt::readonly(mode as RawMode),
124-
ext: std::os::unix::fs::PermissionsExt::from_mode(mode),
126+
ext: crate::fs::PermissionsExt::from_mode(mode),
125127
}
126128
}
127129
}

cap-primitives/src/rustix/fs/permissions_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl ImplPermissionsExt {
5050
}
5151

5252
#[cfg(not(target_os = "wasi"))]
53-
impl std::os::unix::fs::PermissionsExt for ImplPermissionsExt {
53+
impl crate::fs::PermissionsExt for ImplPermissionsExt {
5454
fn mode(&self) -> u32 {
5555
self.mode as u32
5656
}

0 commit comments

Comments
 (0)