Commit 76b11cd
Replace unsafe transmute to a cast
`unsafe { mem::transmute::<i16, u16>(exp) } as u64`
is equivalent to `exp as u16 as u64`, this can be
verified with a simple program:
```rust
fn main() {
for i in i16::MIN ..= i16::MAX {
assert_eq!(
unsafe { std::mem::transmute::<i16, u16>(i) } as u64,
i as u16 as u64
)
}
}
```1 parent bfabcc9 commit 76b11cd
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
1259 | 1258 | | |
1260 | 1259 | | |
1261 | 1260 | | |
1262 | | - | |
| 1261 | + | |
1263 | 1262 | | |
1264 | 1263 | | |
1265 | 1264 | | |
| |||
0 commit comments