mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 09:15:32 +01:00
Fixing panic on history save fail
Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
@ -97,8 +97,9 @@ pub fn interactive(env: Env) {
|
||||
match line {
|
||||
Ok(line) => {
|
||||
// TODO: should handle this in a different way
|
||||
rl.add_history_entry(&line).unwrap();
|
||||
rl.save_history(&history).unwrap();
|
||||
rl.add_history_entry(&line).unwrap_or_default();
|
||||
rl.save_history(&history)
|
||||
.unwrap_or_else(|e| eprintln!("; WARNING: saving history: {}", e));
|
||||
|
||||
parser.push(&line);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user