Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ffminus
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
ffminus
2y ago
It lets you have a middle ground, with the decision of when breaking happens left up to library users. Without non_exhaustive, all consumers always get your second scenario. With non_exhaustive, individual zoos get to pick their own policy
2.
▲
by
ffminus
2y ago
Library users can force a compile error when new variants get added, using a lint from rustc. It's "allow" by default, so it's opt-in. https://doc.rust-lang.org/rustc/lints/listing/allowed-