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
But the documentation for to_u64 in the ToPrimitive trait states (emphasis added):
Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
The current implementation doesn't match the documentation. Non-integral Ratio values cannot be represented as u64, so calling to_u64 on them should return None according to the documentation. Instead, it returns the rounded value, provided it is within the range of a u64.
Either the implementation or the documentation should be adjusted.