2016-04-26 12:51:14 -05:00
|
|
|
#![crate_name="cci_impl_lib"]
|
|
|
|
|
|
|
|
pub trait uint_helpers {
|
|
|
|
fn to<F>(&self, v: usize, f: F) where F: FnMut(usize);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl uint_helpers for usize {
|
|
|
|
#[inline]
|
|
|
|
fn to<F>(&self, v: usize, mut f: F) where F: FnMut(usize) {
|
|
|
|
let mut i = *self;
|
|
|
|
while i < v {
|
|
|
|
f(i);
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
}
|
2015-03-18 16:05:24 -05:00
|
|
|
}
|