1
Fork 0

range() is pure

This commit is contained in:
Niko Matsakis 2012-07-20 16:36:42 -07:00
parent 168306f11b
commit f061560ce4

View file

@ -39,7 +39,7 @@ pure fn is_nonnegative(x: T) -> bool { x >= 0 as T }
#[inline(always)] #[inline(always)]
/// Iterate over the range [`lo`..`hi`) /// Iterate over the range [`lo`..`hi`)
fn range(lo: T, hi: T, it: fn(T) -> bool) { pure fn range(lo: T, hi: T, it: fn(T) -> bool) {
let mut i = lo; let mut i = lo;
while i < hi { while i < hi {
if !it(i) { break } if !it(i) { break }