How to skip the first item(s) of an iterator in Rust? -


when iterating on arguments (for example) thats straightforward way skip first n elements?

eg:

use std::env;  fn main() {     arg in env::args() {         println!("argument: {}", arg);     } } 

i tried env::args()[1..] slicing isn't supported.

whats simplest way skip first arguments of iterator?

turns out .skip() method can used, eg:

use std::env;  fn main() {     arg in env::args().skip(1) {         println!("argument: {}", arg);     } } 

Comments

Popular posts from this blog

PHP while loop dynamic rowspan -

timer - Java TimerTask cancel -

android - How to read a column value in parse.com without accessing an object or a pointer -