Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
duped
on Sept 22, 2023
|
parent
|
context
|
favorite
| on:
Using enums to represent state in Rust
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.
hurril
on Sept 22, 2023
[–]
Why is that a bad example? It's proof that implementing From does not solve the problem.
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: