summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 9bea756..a22b553 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -39,8 +39,12 @@ fn main() {
while let Some(line) = reader.read_line(&mut buffer) {
match line {
Ok(l) => {
- for choice in &config.opt.choice {
+ let choice_iter = &mut config.opt.choice.iter().peekable();
+ while let Some(choice) = choice_iter.next() {
choice.print_choice(&l, &config, &mut handle);
+ if choice_iter.peek().is_some() {
+ choice::Choice::write_separator(&config, &mut handle);
+ }
}
match handle.write(b"\n") {
Ok(_) => (),