Inline range for all integral types

This commit is contained in:
Ben Striegel
2012-06-08 21:18:41 -04:00
parent d182c14247
commit 89e424d373

View File

@@ -38,6 +38,7 @@ pure fn is_negative(x: T) -> bool { x < 0 as T }
pure fn is_nonpositive(x: T) -> bool { x <= 0 as T }
pure fn is_nonnegative(x: T) -> bool { x >= 0 as T }
#[inline(always)]
#[doc = "Iterate over the range [`lo`..`hi`)"]
fn range(lo: T, hi: T, it: fn(T) -> bool) {
let mut i = lo;