Browse Source

Fix repl with updated rustyline

pull/23/head
ehsanmok 1 year ago
parent
commit
006394e84f
  1. 7
      calculator/src/bin/repl.rs

7
calculator/src/bin/repl.rs

@ -1,7 +1,7 @@
#![allow(unused_imports, unused_variables)]
use rustyline::error::ReadlineError;
use rustyline::Editor;
use rustyline::{DefaultEditor, Result};
use cfg_if::cfg_if;
@ -20,8 +20,8 @@ cfg_if! {
}
// ANCHOR: repl
fn main() {
let mut rl = Editor::<()>::new();
fn main() -> Result<()> {
let mut rl = DefaultEditor::new()?;
println!("Calculator prompt. Expressions are line evaluated.");
loop {
let readline = rl.readline(">> ");
@ -57,5 +57,6 @@ fn main() {
}
}
}
Ok(())
// ANCHOR_END: repl
}

Loading…
Cancel
Save