Skip to content

Commit 7737a37

Browse files
committed
fix
1 parent a98c56b commit 7737a37

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

crates/common/src/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub mod ffi {
118118

119119
fn from_bytes(slice: &[u8]) -> &OsStr {
120120
// WASI strings are guaranteed to be UTF-8
121-
OsStr::new(std::str::from_utf8(slice).expect("wasip2 strings are UTF-8"))
121+
OsStr::new(core::str::from_utf8(slice).expect("wasip2 strings are UTF-8"))
122122
}
123123
}
124124

crates/vm/src/stdlib/os.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ pub(super) mod _os {
658658
match self.stat(DirFd::default(), FollowSymlinks(follow_symlinks), vm) {
659659
Ok(stat_obj) => {
660660
let st_mode: i32 = stat_obj.get_attr("st_mode", vm)?.try_into_value(vm)?;
661+
#[allow(clippy::unnecessary_cast)]
661662
Ok((st_mode as u32 & libc::S_IFMT as u32) == mode_bits)
662663
}
663664
Err(e) => {
@@ -686,7 +687,7 @@ pub(super) mod _os {
686687
}
687688
}
688689
#[cfg(unix)]
689-
return self.test_mode_via_stat(follow_symlinks.0, libc::S_IFDIR as u32, vm);
690+
return self.test_mode_via_stat(follow_symlinks.0, libc::S_IFDIR as _, vm);
690691
#[cfg(not(unix))]
691692
match super::fs_metadata(&self.pathval, follow_symlinks.0) {
692693
Ok(meta) => Ok(meta.is_dir()),
@@ -711,7 +712,7 @@ pub(super) mod _os {
711712
}
712713
}
713714
#[cfg(unix)]
714-
return self.test_mode_via_stat(follow_symlinks.0, libc::S_IFREG as u32, vm);
715+
return self.test_mode_via_stat(follow_symlinks.0, libc::S_IFREG as _, vm);
715716
#[cfg(not(unix))]
716717
match super::fs_metadata(&self.pathval, follow_symlinks.0) {
717718
Ok(meta) => Ok(meta.is_file()),
@@ -732,7 +733,7 @@ pub(super) mod _os {
732733
return Ok(dt == libc::DT_LNK);
733734
}
734735
#[cfg(unix)]
735-
return self.test_mode_via_stat(false, libc::S_IFLNK as u32, vm);
736+
return self.test_mode_via_stat(false, libc::S_IFLNK as _, vm);
736737
#[cfg(not(unix))]
737738
Err(io::Error::other("file_type unavailable").into_pyexception(vm))
738739
}
@@ -1146,7 +1147,7 @@ pub(super) mod _os {
11461147
mode: OutputMode::String,
11471148
lstat: OnceCell::new(),
11481149
stat: OnceCell::new(),
1149-
ino: AtomicCell::new(ino),
1150+
ino: AtomicCell::new(ino as _),
11501151
}
11511152
.into_ref(&vm.ctx)
11521153
.into(),

0 commit comments

Comments
 (0)