splop 0.2.0

Helper functions to determine the first/last repetition of something.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate splop;

use splop::SkipFirst;

fn main() {
    let mut comma = SkipFirst::new();

    print!("[");
    for name in &["banana", "melon", "kiwi"] {
        comma.skip_first(|| print!(", "));
        print!("{}", name);
    }

    println!("]");
}