jhpratt / deranged

Proof of concept ranged integers in Rust.
Apache License 2.0
38 stars 5 forks source link

Implement `Bounded` #7

Closed WhyNotHugo closed 2 years ago

WhyNotHugo commented 2 years ago

Is it feasible to implement num_traits::bounds::Bounded?

jhpratt commented 2 years ago

Yes, this could be done trivially. Are you actually using this crate? To my knowledge nobody actually does; there's certainly no reverse dependencies on crates.io.

My goal when creating this crate was twofold: I wanted to play around to see how it would work with pre-existing APIs and I wanted to see how feasible implementations were for stdlib. The third-party trait implementations that exist right now are because that's what I needed for my "playing around" use case.

WhyNotHugo commented 2 years ago

I used it for a small tool to control brightness -- where values are percentages (e.g.: ranged numbers from 1 to 100). But it's been parked for a long time TBH (hence, not published).

jhpratt commented 2 years ago

Okay! I'll get to this tonight. It should just be a few lines. It'll be behind the num feature gate.

jhpratt commented 2 years ago

Implemented and released.