Skip to content

Commit

Permalink
minor int-template.rs cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wting committed Jan 21, 2013
1 parent 885f0a2 commit 04d38f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/int-template.rs
Expand Up @@ -72,7 +72,7 @@ pub pure fn is_nonnegative(x: T) -> bool { x >= 0 as T }

#[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 }
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 04d38f3

Please sign in to comment.