From 681d96ba0fb8a608210feb1ce7ff7f5de1a922e2 Mon Sep 17 00:00:00 2001 From: Justine Date: Tue, 31 Jan 2023 17:35:16 +0100 Subject: [PATCH] Better error handling for history --- src/shell/history.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell/history.rs b/src/shell/history.rs index 2e06b1b..aa6c323 100644 --- a/src/shell/history.rs +++ b/src/shell/history.rs @@ -12,8 +12,8 @@ pub fn write_to_history(command: &str) -> Result<(), std::io::Error> { .write(true) .append(true) .create(true) - .open(&filepath) - .unwrap(); + .open(&filepath)?; + let number = match get_history_number() { Ok(n) => n + 1,