Skip to content

Commit 57cb21f

Browse files
committed
---
yaml --- r: 2725 b: refs/heads/master c: d4da3f5 h: refs/heads/master i: 2723: 789b278 v: v3
1 parent 0791f25 commit 57cb21f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-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: d85447c4fb430e26fee5c3f85997aba1448c29ba
2+
refs/heads/master: d4da3f51728f38030f41cfa320c80e3ffec6e795

trunk/src/lib/int.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,28 @@ iter range(int lo, int hi) -> int {
3232
fn to_str(int n, uint radix) -> str
3333
{
3434
assert (0u < radix && radix <= 16u);
35-
if (n < 0) {
36-
ret "-" + uint::to_str((-n) as uint, radix);
35+
ret if (n < 0) {
36+
"-" + uint::to_str((-n) as uint, radix)
3737
} else {
38-
ret uint::to_str(n as uint, radix);
39-
}
38+
uint::to_str(n as uint, radix)
39+
};
4040
}
4141

4242
fn pow(int base, uint exponent) -> int {
4343

44-
if (exponent == 0u) {
45-
ret 1;
44+
ret if (exponent == 0u) {
45+
1
4646
} else if (base == 0) {
47-
ret 0;
47+
0
4848
} else {
4949
auto accum = base;
5050
auto count = exponent;
5151
while (count > 1u) {
5252
accum *= base;
5353
count -= 1u;
5454
}
55-
ret accum;
56-
}
55+
accum
56+
};
5757
}
5858

5959
// Local Variables:

0 commit comments

Comments
 (0)