17 lines
342 B
Rust
17 lines
342 B
Rust
use std::time::Duration;
|
|
|
|
use comrade::rally;
|
|
|
|
fn main() {
|
|
env_logger::init();
|
|
|
|
let items = vec![1, 2, 3, 4, 5];
|
|
|
|
let (input, output) = rally(items, |item: &_| {
|
|
std::thread::sleep(Duration::from_millis(item * 100));
|
|
return Some(0);
|
|
})
|
|
.unwrap();
|
|
|
|
println!("RALLY RESULTS: {input:?} -> {output:?}");
|
|
}
|