3 ms·
Yeah technically you can always default init fields to None, but then you have to type everything as an Option and the ergonomics are so bad you're really incen
by masklinn 3y ago
Yeah technically you can always default init fields to None, but then you have to type everything as an Option and the ergonomics are so bad you're really incentivised not to do that. In that case you bundle that in a transient structure (a builder) and you get rid of it afterwards.
- vacuity 3y agoOr you use MaybeUninint, which I think is a great example of how unsafe Rust exposes to potential memory unsafety but grants you control when you need it.