Skip to content

Commit 74071a9

Browse files
committed
fix: removing repl history log
1 parent 2cbadf9 commit 74071a9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ async fn main() -> Result<()> {
3838

3939
let mut rl = Editor::<()>::new()?;
4040

41-
if rl.load_history("repl.history").is_err() {
42-
println!("No previous history.");
43-
}
41+
rl.load_history("repl.history").ok();
4442

4543
let client = engine::Rustbase::connect(args.host, args.port).await;
4644

@@ -61,10 +59,13 @@ async fn main() -> Result<()> {
6159
}
6260
Err(ReadlineError::Interrupted) => {
6361
println!("bye");
62+
rl.save_history("repl.history").ok();
63+
6464
break;
6565
}
6666
Err(ReadlineError::Eof) => {
6767
println!("bye");
68+
rl.save_history("repl.history").ok();
6869
break;
6970
}
7071
Err(err) => {

0 commit comments

Comments
 (0)