We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 445d3fe commit 6bce296Copy full SHA for 6bce296
src/lib/_vec.rs
@@ -65,12 +65,11 @@ fn print_debug_info[T](vec[T] v) {
65
66
// Returns elements from [start..end) from v.
67
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)));
+ check (0 <= start);
+ check (start <= end);
+ check (end <= (len[T](v) as int));
72
auto result = alloc[T]((end - start) as uint);
73
- let mutable int i = start;
+ let int i = start;
74
while (i < end) {
75
result += vec(v.(i));
76
i += 1;
0 commit comments