]> git.lizzy.rs Git - rust.git/commit
Make RangeInclusive just a two-field struct
authorScott McMurray <scottmcm@users.noreply.github.com>
Mon, 24 Apr 2017 04:14:32 +0000 (21:14 -0700)
committerScott McMurray <scottmcm@users.noreply.github.com>
Sun, 21 May 2017 08:48:03 +0000 (01:48 -0700)
commitf166bd9857dac3c66e812ba6bc33e59494c3fef2
treed29f84b35bd2428ade46b8282c69f593a9f8645b
parent0bd9e1f5e6e9832691d033f1cc32409f5e2a9145
Make RangeInclusive just a two-field struct

Not being an enum improves ergonomics, especially since NonEmpty could be Empty.  It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait.

Implements RFC 1980
src/libcollections/range.rs
src/libcore/iter/range.rs
src/libcore/ops.rs
src/libcore/slice/mod.rs
src/libcore/str/mod.rs
src/libcore/tests/lib.rs
src/libcore/tests/ops.rs
src/librustc/hir/lowering.rs