rick-de-water/nonany
Integer types with customizable niche values
▲ 1 hacker recommends Rust ★ 51 Apache-2.0 nichenonanynonmaxnonminnonzerorust
Recommended between 2026-04-27 and 2026-04-27. Last pushed 2024-11-18.
▲ 1 recommend · ▼ 0 criticisms
What hackers say
“nonany [2] which uses xor operations to map your custom niche value to 0 so it can use the NonZero* types to achieve the same in stable rust.”
— wongarsu, 2026-04-27 · original comment on Hacker News ↗
show original comment
There is nook which does it with unstable features [1] and nonany [2] which uses xor operations to map your custom niche value to 0 so it can use the NonZero* types to achieve the same in stable rust. Eventually rust will likely gain pattern types as a more generally useful version of the features used in nook. There is even some actively ongoing work on this [3] 1: https://github.com/tialaramex/nook/blob/main/src/balanced.rs 2: https://github.com/rick-de-water/nonany 3: https://github.com/rust-lang/rust/issues/135996
Badge for your README
[](https://hackerrepos.org/repo/rick-de-water/nonany)