mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
12 lines
199 B
Rust
12 lines
199 B
Rust
#![crate_name="cci_iter_lib"]
|
|
|
|
#[inline]
|
|
pub fn iter<T, F>(v: &[T], mut f: F) where F: FnMut(&T) {
|
|
let mut i = 0;
|
|
let n = v.len();
|
|
while i < n {
|
|
f(&v[i]);
|
|
i += 1;
|
|
}
|
|
}
|