]> git.lizzy.rs Git - rust.git/commit
Add Range[Inclusive]::is_empty
authorScott McMurray <scottmcm@users.noreply.github.com>
Fri, 9 Feb 2018 09:47:18 +0000 (01:47 -0800)
committerScott McMurray <scottmcm@users.noreply.github.com>
Fri, 9 Feb 2018 09:47:18 +0000 (01:47 -0800)
commit4f8049a2b00c46cb1ac77cabaaf716895f185afe
tree9d04efd20feb079c5cc6e1a5182535109a8ca47c
parentafa8acce251cda7ab1548640fdb769139a45f839
Add Range[Inclusive]::is_empty

During the RFC, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it.  It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- not even Range<i32> or RangeInclusive<usize>.
src/libcore/iter/traits.rs
src/libcore/ops/range.rs
src/libcore/tests/iter.rs
src/libcore/tests/lib.rs
src/libcore/tests/ops.rs