mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
better way of fetching the error message
This commit is contained in:
parent
6e4b41a2f4
commit
4cfa7c124d
2 changed files with 4 additions and 2 deletions
|
@ -283,7 +283,10 @@ impl<T> RocCallResult<T> {
|
|||
match self.tag {
|
||||
0 => Ok(unsafe { self.value.assume_init() }),
|
||||
n => Err({
|
||||
let msg: &RocStr = unsafe { &*self.error_msg };
|
||||
let mut msg = RocStr::default();
|
||||
|
||||
unsafe { std::ptr::swap(&mut msg, self.error_msg) };
|
||||
|
||||
let tag = (n - 1) as u32;
|
||||
let tag = tag
|
||||
.try_into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue