-
Notifications
You must be signed in to change notification settings - Fork 430
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
Implement From<RangeInclusive>
for Uniform
#556
Comments
Good idea. This is at least the third incentive I've come across to require Rust 1.26, although we don't need it. |
I think we should have a release with all the new features possible without bumping the minimal version. The idea is to make adoption of the new API more likely for crates caring about this. |
We already have the |
That would work, however this does not actually require nightly, just Rust 1.26, so it would be a bit weird. Maybe better than nothing? We could also introduce a Unfortunately, we don't have conditional compilation for Rust versions AFAIK. |
You still can't access However as of Rust 1.27 you can use |
I would prefer to have a |
We could reuse this for SIMD though, which I think would make it worthwhile. |
This syntactic sugar would allow to use
Uniform::from(1..=10)
instead ofUniform::new_inclusive(1, 10)
, but requires Rust 1.26. I don't think it is worth it to add a feature or raise the minimum required Rust version, but at some point we might want to implement it.The implementation itself is trivial:
The text was updated successfully, but these errors were encountered: