Skip to content

Commit

Permalink
fix: usize conversion
Browse files Browse the repository at this point in the history
Co-authored-by: Joel Dice <[email protected]>
  • Loading branch information
vados-cosmonic and dicej authored Jan 15, 2025
1 parent b61ed4e commit 0f19243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/guest-rust/rt/src/async_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ impl ErrorContext {
unsafe {
let mut ret = [0u32; 2];
error_context_debug_message(self.handle, ret.as_mut_ptr() as *mut _);
String::from_raw_parts(ret[0] as *mut _, ret[1] as usize, ret[1] as usize)
let len = usize::try_from(ret[1]).unwrap();
String::from_raw_parts(usize::try_from(ret[0]).unwrap() as *mut _, len, len)
}
}
}
Expand Down

0 comments on commit 0f19243

Please sign in to comment.