New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some way to combine Bounded and Unsigned + Zero #208
Comments
I'm surprised there's a scenario where a possibly-negative minimum would be useful without also caring about a maximum. Can you show an example of how you would use this? Maybe we could have a trait that returns |
In this particular case, it was because |
210: Add LowerBounded/UpperBounded traits r=cuviper a=clarfonthey Potential solution for #208. With a breaking change, these could simply become supertraits of `Bounded`, but until then, we have to deal with blanket implementations. I added both simply because it was easy to do so, although we could opt to not require both. I don't see it being that negative to include both, however. Co-authored-by: ltdk <usr@ltdk.xyz>
Closing this issue since the PR I merged accounts for this. |
Right now it would be a breaking change to split up the
Bounded
trait, but I at least have one use case for this after messing around with proptest-rs/proptest#235: there are types that are lower-bounded but not upper-bounded, specificallyBigUint
. Would be nice to be able to have a trait that lets you get a min_value without requiring a max_value, since right nowBounded
andUnsigned + Zero
may overlap and we can't rely on that.The text was updated successfully, but these errors were encountered: