Skip to content

Commit a65e19f

Browse files
committed
---
yaml --- r: 1697 b: refs/heads/master c: 8aa946f h: refs/heads/master i: 1695: 772b44d v: v3
1 parent 5bb6b1c commit a65e19f

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
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: e8938f5fb2cfa756b8186f6ed33e2d0d509a31a0
2+
refs/heads/master: 8aa946ff5e312543a4e3903ee0d3580fbd8d2887

trunk/src/lib/_int.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ fn negative(int x) -> bool { ret x < 0; }
1717
fn nonpositive(int x) -> bool { ret x <= 0; }
1818
fn nonnegative(int x) -> bool { ret x >= 0; }
1919

20-
iter range(mutable int lo, int hi) -> int {
21-
while (lo < hi) {
22-
put lo;
23-
lo += 1;
20+
iter range(int lo, int hi) -> int {
21+
let int lo_ = lo;
22+
while (lo_ < hi) {
23+
put lo_;
24+
lo_ += 1;
2425
}
2526
}
2627

27-
fn to_str(mutable int n, uint radix) -> str
28+
fn to_str(int n, uint radix) -> str
2829
{
2930
check (0u < radix && radix <= 16u);
3031
if (n < 0) {

trunk/src/lib/_uint.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ fn ne(uint x, uint y) -> bool { ret x != y; }
1212
fn ge(uint x, uint y) -> bool { ret x >= y; }
1313
fn gt(uint x, uint y) -> bool { ret x > y; }
1414

15-
iter range(mutable uint lo, uint hi) -> uint {
16-
while (lo < hi) {
17-
put lo;
18-
lo += 1u;
15+
iter range(uint lo, uint hi) -> uint {
16+
auto lo_ = lo;
17+
while (lo_ < hi) {
18+
put lo_;
19+
lo_ += 1u;
1920
}
2021
}
2122

@@ -32,8 +33,10 @@ fn next_power_of_two(uint n) -> uint {
3233
ret tmp + 1u;
3334
}
3435

35-
fn to_str(mutable uint n, uint radix) -> str
36+
fn to_str(uint num, uint radix) -> str
3637
{
38+
auto n = num;
39+
3740
check (0u < radix && radix <= 16u);
3841
fn digit(uint n) -> char {
3942
alt (n) {

0 commit comments

Comments
 (0)