4 ms·
Small nitpick : In Rust you would use an Enum (a discriminated Union) for this not an Union and you wouldn't need unsafe.
by dc01 4y ago
Small nitpick :
In Rust you would use an Enum (a discriminated Union) for this not an Union and you wouldn't need unsafe.
- valenterry 4y agoThat's exactly my point: you should not have to define and use an enum here. The compiler should be smart enough to figure out that the result will be `Result<T, Error1 | Error2>` without the user doing anything here.