-
Notifications
You must be signed in to change notification settings - Fork 147
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
Trait for Upcasting / Widening #97
Comments
I think |
BTW, nice graph! You might simplify it a bit by leaving it implicit for transitive conversions. That is, if A->B and B->C, then implicitly A->C. Hmm, I wonder if a generic impl can express that, something like:
But the existence of (don't mind me, just musing...) |
Maybe the conv crate covers this appropriately now. |
Does But I noticed nightly |
Nice! I had missed that. Please do if you want to! |
This is a spiritual successor to #28921, completing the "upcast" idea from rust-num/num#97.
The float conversions are now merged! I think there's nothing else to do here. |
Nice! |
Specialize parser for Iter=&[u8]
Should num include a trait for upcasting / widening? I.e. all numerical casts that can be performed with no loss of information. Or is this more appropriate for a separate crate?
Here's a graph of the allowed upcasts: http://i.imgur.com/foiXWWS.png (not including self loops).
scratch impl follows
The text was updated successfully, but these errors were encountered: