diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-09 16:11:56 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-09 16:40:58 -0800 |
| commit | 321fd80219e024cabb7ee539e701bc6b4a258751 (patch) | |
| tree | a0dc81403ffd175f75c704e1a26765339b63907a /src/libcore/uint.rs | |
| parent | 4ffcb959744194413ca20223274d2c351ad7686c (diff) | |
Add an infinite loop construct
Add a loop {} construct for infinite loops, and use it in test
cases. See #1906 for details.
Diffstat (limited to 'src/libcore/uint.rs')
| -rw-r--r-- | src/libcore/uint.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/uint.rs b/src/libcore/uint.rs index 69981d2e980..776965d350a 100644 --- a/src/libcore/uint.rs +++ b/src/libcore/uint.rs @@ -138,7 +138,7 @@ fn range(lo: uint, hi: uint, it: fn(uint)) { } /* -Function: loop +Function: iterate Iterate over the range [`lo`..`hi`), or stop when requested @@ -153,7 +153,7 @@ Returns: `true` If execution proceeded correctly, `false` if it was interrupted, that is if `it` returned `false` at any point. */ -fn loop(lo: uint, hi: uint, it: fn(uint) -> bool) -> bool { +fn iterate(lo: uint, hi: uint, it: fn(uint) -> bool) -> bool { let mut i = lo; while i < hi { if (!it(i)) { ret false; } |
