3 ms·
- Float ranges can't be used for indexing/slicing slices - Float ranges don't implement Iterator - Rust is clever enough to make is_empty checks NaN robust, s
by dathinab 6y ago
- Float ranges can't be used for indexing/slicing slices
- Float ranges don't implement Iterator
- Rust is clever enough to make is_empty checks NaN robust, so `is_empty` return true
- contains checks if it's inside the stard bound and inside the end bounds, but whichever of the bounds is NaN is always not inside the bounds and as such the range won't contain anything (which matches with the behaviour of is_empty)
So it works well.
But float ranges are kinda useless for anything but the contains/is_empty methods.