Skip to content

Commit 6bce296

Browse files
committed
Address FIXME in _vec waiting on closed issue rust-lang#108.
1 parent 445d3fe commit 6bce296

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib/_vec.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ fn print_debug_info[T](vec[T] v) {
6565

6666
// Returns elements from [start..end) from v.
6767
fn slice[T](vec[T] v, int start, int end) -> vec[T] {
68-
check(0 <= start);
69-
check(start <= end);
70-
// FIXME #108: This doesn't work yet.
71-
//check(end <= int(len[T](v)));
68+
check (0 <= start);
69+
check (start <= end);
70+
check (end <= (len[T](v) as int));
7271
auto result = alloc[T]((end - start) as uint);
73-
let mutable int i = start;
72+
let int i = start;
7473
while (i < end) {
7574
result += vec(v.(i));
7675
i += 1;

0 commit comments

Comments
 (0)