aboutsummaryrefslogtreecommitdiffstats
path: root/src/local/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/local/history.rs')
-rw-r--r--src/local/history.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/local/history.rs b/src/local/history.rs
index 06a350fc..d88353f9 100644
--- a/src/local/history.rs
+++ b/src/local/history.rs
@@ -24,9 +24,9 @@ impl History {
session: Option<String>,
hostname: Option<String>,
) -> Self {
- let session = session.unwrap_or_else(|| {
- env::var("ATUIN_SESSION").unwrap_or_else(|_| Uuid::new_v4().to_simple().to_string())
- });
+ let session = session
+ .or_else(|| env::var("ATUIN_SESSION").ok())
+ .unwrap_or_else(|| Uuid::new_v4().to_simple().to_string());
let hostname =
hostname.unwrap_or_else(|| hostname::get().unwrap().to_str().unwrap().to_string());