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
In order to implement size_hint() on Range, we need some numeric trait that covers the ability to convert a given type to uint (or more generally, Option<uint>, to cover out of bounds conversions).
More specifically, we need to convert the result of a - b where a and b are values of the numeric type. The definition for this conversion to uint would be the number of times that you'd have to add One::one() to the result to get a back (which is the obvious definition, really).
This is needed because range() doesn't restrict its inputs to primitive numeric types.