-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support from creating Range
from Bound
#253
Comments
Doesn't |
It takes anything that implements RangeBounds. Here is the link to the docs: https://pubgrub-rs.github.io/pubgrub/pubgrub/range/struct.Range.html#method.from_range_bounds And since it auto implemented for a pair of bounds I think you can direcly put a pair of bounds there: https://doc.rust-lang.org/nightly/core/ops/trait.RangeBounds.html#impl-RangeBounds%3CT%3E-for-(Bound%3CT%3E,+Bound%3CT%3E) |
Thanks, I totally missed that! In our use case, we pass in two Range::from_range_bounds::<(Bound<Version>, Bound<Version>), _>((
value.0.into(),
value.1.into(),
)) |
Got it, apologies. Skill issue! |
Thanks for the clarification. |
@konstin, is there a better way for the generics on the fn? I'd be open to resuturing to make it EZer to use. |
In uv, I have two
Bound<Version>
that I need to turn into aRange
. I ended up doing this semi-manually here. It would be nice to have a public constructor, if appropriate.The text was updated successfully, but these errors were encountered: