miniblog.
← Back to all posts
Wilfred Hughes
Jan 15, 2022 at 20:26
TIL about Rust's NonZeroUsize, which is an integer that is never zero. Rust can optimise Option<NonZeroUsize> to be the same size in memory as usize!
https://doc.rust-lang.org/std/num/struct.NonZeroUsize.html
Not Found