RosettaCodeData/Task/Repeat/Rust/repeat-1.rust

4 lines
70 B
Plaintext

fn repeat(f: impl FnMut(usize), n: usize) {
(0..n).for_each(f);
}