aboutsummaryrefslogtreecommitdiffstats
path: root/src/local/history.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conradludgate@gmail.com>2021-02-14 18:00:41 +0000
committerGitHub <noreply@github.com>2021-02-14 18:00:41 +0000
commitbae59474eef3fd28758a2a4e5e4fb8d50c93a3c4 (patch)
treed0c85ade3768dc9b04f6d94c9d9b5c360a17c257 /src/local/history.rs
parenttidy some stuff (#6) (diff)
downloadatuin-bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4.zip
a few more tiny touch ups (#7)
* a few more tiny touch ups * all praise clippy
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());