about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorAlex Burka <aburka@seas.upenn.edu>2016-01-13 13:12:16 -0500
committerAlex Burka <aburka@seas.upenn.edu>2016-02-27 02:01:41 -0500
commit24cc90262bd5ec52aa421103ef7c89a0697b046d (patch)
tree8184668622741faa62a24660cf57433ab81a8337 /src/libcollections
parent15a8a296b724599a1eda807c3057338b11cb94bf (diff)
note work still to be done
In particular, uses of inclusive ranges within the standard library are
still waiting. Slices and collections can be sliced with `usize` and
`Range*<usize>`, but not yet `Range*Inclusive<usize>`.

Also, we need to figure out what to do about `RangeArgument`. Currently
it has `start()` and `end()` methods which are pretty much identical to
`Range::start` and `Range::end`. For the same reason as Range itself,
these methods can't express a range such as `0...255u8` without
overflow. The easiest choice, it seems to me, is either changing the
meaning of `end()` to be inclusive, or adding a new method, say
`last()`, that is inclusive and specifying that `end()` returns `None`
in cases where it would overflow. Changing the semantics would be a
breaking change, but `RangeArgument` is unstable so maybe we should do
it anyway.
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/range.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcollections/range.rs b/src/libcollections/range.rs
index afcd779ddf1..4e39191b472 100644
--- a/src/libcollections/range.rs
+++ b/src/libcollections/range.rs
@@ -35,6 +35,7 @@ pub trait RangeArgument<T> {
     }
 }
 
+// FIXME add inclusive ranges to RangeArgument
 
 impl<T> RangeArgument<T> for RangeFull {}