- print!("> ");
- io::stdout().flush().unwrap(); // Without flushing, the `>` doesn't print
- for line in stdin.lock().lines() {
- let line = line.unwrap();
+ let mut line_reader = stdin.lock().lines();
+ loop {
+ print!("> ");
+ io::stdout().flush().unwrap(); // Without flushing, the `>` doesn't print
+ let line = match line_reader.next() {
+ Some(l) => l.unwrap(),
+ None => break,
+ };