1extern crate splop; 2 3use splop::SkipFirst; 4 5fn main() { 6 let mut comma = SkipFirst::new(); 7 8 print!("["); 9 for name in &["banana", "melon", "kiwi"] { 10 comma.skip_first(|| print!(", ")); 11 print!("{}", name); 12 } 13 14 println!("]"); 15}