Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix win
  • Loading branch information
youknowone committed Feb 5, 2026
commit 6486a3c6f21813f3707ccdfbac2a23c3b026455d
2 changes: 1 addition & 1 deletion crates/vm/src/stdlib/ctypes/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ pub(super) fn bytes_to_pyobject(
unsafe { core::slice::from_raw_parts(ptr as *const libc::wchar_t, len) };
let s: String = wchars
.iter()
.filter_map(|&c| u32::try_from(c).ok().and_then(char::from_u32))
.filter_map(|&c| char::from_u32(c as u32))
.collect();
Ok(vm.ctx.new_str(s).into())
}
Expand Down
4 changes: 1 addition & 3 deletions crates/vm/src/stdlib/ctypes/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,7 @@ impl PyCPointer {
for _ in 0..len {
let addr = (ptr_value as isize + cur * wchar_size as isize) as *const libc::wchar_t;
unsafe {
if let Ok(value) = u32::try_from(*addr)
&& let Some(c) = char::from_u32(value)
{
if let Some(c) = char::from_u32(*addr as u32) {
result.push(c);
}
}
Expand Down