cbarrick@lemmy.world to Rust@programming.devEnglish · 1 year agoDesigning error types in Rustmmapped.blogexternal-linkmessage-square4fedilinkarrow-up124arrow-down10
arrow-up124arrow-down1external-linkDesigning error types in Rustmmapped.blogcbarrick@lemmy.world to Rust@programming.devEnglish · 1 year agomessage-square4fedilink
minus-squareo11c@programming.devlinkfedilinkEnglisharrow-up1·1 year agoOne 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.
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 writematch error ... unreachable
.