aboutsummaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/atuin-client/src/utils.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/atuin-client/src/utils.rs b/crates/atuin-client/src/utils.rs
index a7c6eab0..35d7db26 100644
--- a/crates/atuin-client/src/utils.rs
+++ b/crates/atuin-client/src/utils.rs
@@ -1,11 +1,11 @@
pub(crate) fn get_hostname() -> String {
- std::env::var("ATUIN_HOST_NAME").unwrap_or_else(|_| {
- whoami::fallible::hostname().unwrap_or_else(|_| "unknown-host".to_string())
- })
+ std::env::var("ATUIN_HOST_NAME")
+ .unwrap_or_else(|_| whoami::hostname().unwrap_or_else(|_| "unknown-host".to_string()))
}
pub(crate) fn get_username() -> String {
- std::env::var("ATUIN_HOST_USER").unwrap_or_else(|_| whoami::username())
+ std::env::var("ATUIN_HOST_USER")
+ .unwrap_or_else(|_| whoami::username().unwrap_or_else(|_| "unknown-user".to_string()))
}
/// Returns a pair of the hostname and username, separated by a colon.