Skip to content

Commit 4c1aff1

Browse files
authored
Merge pull request #2 from unicorn-engine/fix-win-try-from
fix
2 parents 6eec7d8 + 4127235 commit 4c1aff1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/unicorn-sys/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl TryFrom<i32> for Mode {
9494
if (v & !VALID_MODES) != 0 {
9595
return Err(uc_error::MODE);
9696
}
97-
Ok(Self(v as u32))
97+
Ok(Self(v.try_into().map_err(|_| uc_error::MODE)?))
9898
}
9999
}
100100

0 commit comments

Comments
 (0)