From 04d38f38e72146ee7709f24e16e1d9cd5df41adc Mon Sep 17 00:00:00 2001 From: William Ting Date: Mon, 21 Jan 2013 11:15:11 -0600 Subject: [PATCH] minor int-template.rs cleanup --- src/libcore/int-template.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/int-template.rs b/src/libcore/int-template.rs index a04610d1995..e62c7f095b0 100644 --- a/src/libcore/int-template.rs +++ b/src/libcore/int-template.rs @@ -72,7 +72,7 @@ #[inline(always)] /// Iterate over the range [`lo`..`hi`) -pub fn range(lo: T, hi: T, it: fn(T) -> bool) { +pub pure fn range(lo: T, hi: T, it: fn(T) -> bool) { let mut i = lo; while i < hi { if !it(i) { break } @@ -150,7 +150,7 @@ impl T: iter::Times { `x` is an int, this is functionally equivalent to \ `for int::range(0, x) |_i| { /* anything */ }`."] pure fn times(&self, it: fn() -> bool) { - if *self < 0 { + if is_negative(*self) { fail fmt!("The .times method expects a nonnegative number, \ but found %?", self); }