Re:Using enums to represent state in Rust
by duped on Friday September 22, 2023 @12:24PM
(#37614054)
Bad example, that should panic (in a perfect world it should be a compile error). The invariant of the type is that `E::Rest` cannot hold zero.
[ Parent
| on HN ]