fork download
  1. fn main() {
  2. println!("{:?}", [1, 2, 3, 4, 5].iter().step_by(2).collect::<Vec<_>>());
  3. }
  4.  
Success #stdin #stdout 0s 4508KB
stdin
Standard input is empty
stdout
[1, 3, 5]