2 ms·
You have no benefits from containing this. No of the problems come from this not being constrained on PartialOrd. Instead they are related to other things like
by dathinab 6y ago
You have no benefits from containing this.
No of the problems come from this not being constrained on PartialOrd. Instead they are related to other things like the usability benefit of range construction not being fallible (which is why we can't have a start <= end constraint in the type).
Some things could be done differently by constraining the type to always be an integer, but expect `constains` now not needing a reference non of the thinks the article complained about would be different just by constraining it to an integer. In practice many of it's method are anyway only defined for some Range types like you can only use `Range<usize>` for slicing.