diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-02-14 15:15:26 +0000 |
|---|---|---|
| committer | Ellie Huxtable <e@elm.sh> | 2021-02-14 15:35:08 +0000 |
| commit | 660edfefed7e658ed73ef64cd20582e390bb0cc5 (patch) | |
| tree | 39dde592e4ce6361eb69ff3cc402176caaf4dbe3 /src/local/history.rs | |
| parent | Make clippy annoying asf + add server (diff) | |
| download | atuin-660edfefed7e658ed73ef64cd20582e390bb0cc5.zip | |
Make pedantic clippy happy
Diffstat (limited to 'src/local/history.rs')
| -rw-r--r-- | src/local/history.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/local/history.rs b/src/local/history.rs index 893edbb7..e46180b8 100644 --- a/src/local/history.rs +++ b/src/local/history.rs @@ -23,10 +23,10 @@ impl History { duration: i64, session: Option<String>, hostname: Option<String>, - ) -> History { + ) -> Self { // get the current session or just generate a random string let env_session = - env::var("ATUIN_SESSION").unwrap_or(Uuid::new_v4().to_simple().to_string()); + env::var("ATUIN_SESSION").unwrap_or_else(|_| Uuid::new_v4().to_simple().to_string()); // best attempt at getting the current hostname, or just unknown let os_hostname = hostname::get().unwrap(); @@ -36,7 +36,7 @@ impl History { let session = session.unwrap_or(env_session); let hostname = hostname.unwrap_or(os_hostname); - History { + Self { id: Uuid::new_v4().to_simple().to_string(), timestamp, command, |
