Skip to content

Commit f8a9b7b

Browse files
committed
---
yaml --- r: 2716 b: refs/heads/master c: 0755a30 h: refs/heads/master v: v3
1 parent 2954a19 commit f8a9b7b

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6432599c5d7f2646c0f91c6badef5496f2fbc119
2+
refs/heads/master: 0755a30051c33c533ae2feb09924e561f7557143

trunk/src/lib/deque.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ fn create[T]() -> t[T] {
3232

3333
fn fill[T](uint i, uint nelts, uint lo,
3434
vec[cell[T]] old) -> cell[T] {
35-
if (i < nelts) {
36-
ret old.((lo + i) % nelts);
35+
ret if (i < nelts) {
36+
old.((lo + i) % nelts)
3737
} else {
38-
ret option::none[T];
39-
}
38+
option::none[T]
39+
};
4040
}
4141

4242
let uint nalloc = uint::next_power_of_two(nelts + 1u);
@@ -45,11 +45,10 @@ fn create[T]() -> t[T] {
4545
}
4646

4747
fn get[T](vec[cell[T]] elts, uint i) -> T {
48-
alt (elts.(i)) {
49-
case (option::some[T](?t)) { ret t; }
50-
case (_) { fail; }
51-
}
52-
fail; // FIXME: remove me when exhaustiveness checking works
48+
ret alt (elts.(i)) {
49+
case (option::some[T](?t)) { t }
50+
case (_) { fail }
51+
};
5352
}
5453

5554
obj deque[T](mutable uint nelts,

0 commit comments

Comments
 (0)