Skip to content

Commit b49c47a

Browse files
committed
Merge pull request #4570 from wting/minor_int_cleanup
minor int-template.rs cleanup
2 parents 3fac6f8 + 04d38f3 commit b49c47a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/int-template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub pure fn is_nonnegative(x: T) -> bool { x >= 0 as T }
7272

7373
#[inline(always)]
7474
/// Iterate over the range [`lo`..`hi`)
75-
pub fn range(lo: T, hi: T, it: fn(T) -> bool) {
75+
pub pure fn range(lo: T, hi: T, it: fn(T) -> bool) {
7676
let mut i = lo;
7777
while i < hi {
7878
if !it(i) { break }
@@ -150,7 +150,7 @@ impl T: iter::Times {
150150
`x` is an int, this is functionally equivalent to \
151151
`for int::range(0, x) |_i| { /* anything */ }`."]
152152
pure fn times(&self, it: fn() -> bool) {
153-
if *self < 0 {
153+
if is_negative(*self) {
154154
fail fmt!("The .times method expects a nonnegative number, \
155155
but found %?", self);
156156
}

0 commit comments

Comments
 (0)