Skip to content

Commit 0f19243

Browse files
fix: usize conversion
Co-authored-by: Joel Dice <[email protected]>
1 parent b61ed4e commit 0f19243

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/guest-rust/rt/src/async_support.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ impl ErrorContext {
344344
unsafe {
345345
let mut ret = [0u32; 2];
346346
error_context_debug_message(self.handle, ret.as_mut_ptr() as *mut _);
347-
String::from_raw_parts(ret[0] as *mut _, ret[1] as usize, ret[1] as usize)
347+
let len = usize::try_from(ret[1]).unwrap();
348+
String::from_raw_parts(usize::try_from(ret[0]).unwrap() as *mut _, len, len)
348349
}
349350
}
350351
}

0 commit comments

Comments
 (0)