diff options
Diffstat (limited to 'src/libcore/int-template.rs')
| -rw-r--r-- | src/libcore/int-template.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs index 3d9de89aa6f..eed439823fc 100644 --- a/src/libcore/int-template.rs +++ b/src/libcore/int-template.rs @@ -98,12 +98,12 @@ impl T: iter::Times { will execute the given function exactly x times. If we assume that \ `x` is an int, this is functionally equivalent to \ `for int::range(0, x) |_i| { /* anything */ }`."] - pure fn times(it: fn() -> bool) { - if self < 0 { + pure fn times(&self, it: fn() -> bool) { + if *self < 0 { fail fmt!("The .times method expects a nonnegative number, \ but found %?", self); } - let mut i = self; + let mut i = *self; while i > 0 { if !it() { break } i -= 1; |
