How can I use Zig's bitcasts in Rust?

Is there a Rust equivalent to Zig's @bitCast(x)? I need to get the binary data from a u32 into a f32.

Does f32::from_bits do what you want?

2 Likes