You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can TryFrom be implemented as well as FromPrimitive? This would make it easier to make conversions using .try_nto().
I would further propose to allow performing arithmetic between rationals and floats although this would mean that From would make more sense than TryFrom and errors would panic instead of returning an error.
The text was updated successfully, but these errors were encountered:
Ok I see seems like I should be able to basically do exactly the same using cfg attributes and just forward to the FromPrimitive methods. The Results Error type would be empty though as they only return an Option.
I added methods for converting from ints as well (some require try_from/ some can be done through from as they should never fail). In some generic code I'm currently using them as they make it a bit less noisy.
Maybe you can take a look and say if this is too much or seems appropriate?
Can TryFrom be implemented as well as FromPrimitive? This would make it easier to make conversions using
.try_nto()
.I would further propose to allow performing arithmetic between rationals and floats although this would mean that
From
would make more sense thanTryFrom
and errors would panic instead of returning an error.The text was updated successfully, but these errors were encountered: