One problem is that Rust doesn't support tagged unions. enum
is regrettably solving a different problem, but since it's the only hammer we have, it's abused for this kind of thing. This often leads to having to write match error ... unreachable
.
this post was submitted on 18 Jul 2023
22 points (100.0% liked)
Rust
7234 readers
36 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
Error handling was kind of a pain to wrap my head around within the Rust Ecosystem, between the different crates, custom enums and learning about Box. I do enjoy errors now that I understand how the community is using them a little better, and the idea of there being one control flow with errors being a possible 'result'.
Author seems to have some good experience composing errors in Rust applications... good read!