Advertisement
cwchen

[Rust] for loop with step_by

Aug 22nd, 2017
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.11 KB | None | 0 0
  1. #![feature(step_by)]
  2. fn main() {
  3.     for i in (1..).step_by(2).take(5) {
  4.         println!("{}", i);
  5.     }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement