aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock42
-rw-r--r--Cargo.toml2
-rw-r--r--crates/atuin-client/src/utils.rs8
3 files changed, 40 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 6dfdd546..1d0e9bb3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -311,7 +311,7 @@ dependencies = [
"typed-builder",
"urlencoding",
"uuid",
- "whoami",
+ "whoami 2.1.0",
]
[[package]]
@@ -1725,7 +1725,7 @@ checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
dependencies = [
"cfg-if",
"libc",
- "wasi",
+ "wasi 0.11.1+wasi-snapshot-preview1",
]
[[package]]
@@ -2611,7 +2611,7 @@ checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
dependencies = [
"libc",
"log",
- "wasi",
+ "wasi 0.11.1+wasi-snapshot-preview1",
"windows-sys 0.61.2",
]
@@ -3347,7 +3347,7 @@ dependencies = [
"libc",
"once_cell",
"raw-cpuid",
- "wasi",
+ "wasi 0.11.1+wasi-snapshot-preview1",
"web-sys",
"winapi",
]
@@ -4428,7 +4428,7 @@ dependencies = [
"time",
"tracing",
"uuid",
- "whoami",
+ "whoami 1.6.1",
]
[[package]]
@@ -4467,7 +4467,7 @@ dependencies = [
"time",
"tracing",
"uuid",
- "whoami",
+ "whoami 1.6.1",
]
[[package]]
@@ -5357,6 +5357,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
+name = "wasi"
+version = "0.14.7+wasi-0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c"
+dependencies = [
+ "wasip2",
+]
+
+[[package]]
name = "wasip2"
version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5372,6 +5381,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
[[package]]
+name = "wasite"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66fe902b4a6b8028a753d5424909b764ccf79b7a209eac9bf97e59cda9f71a42"
+dependencies = [
+ "wasi 0.14.7+wasi-0.2.4",
+]
+
+[[package]]
name = "wasm-bindgen"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5632,7 +5650,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d"
dependencies = [
"libredox",
- "wasite",
+ "wasite 0.1.0",
+]
+
+[[package]]
+name = "whoami"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8fae98cf96deed1b7572272dfc777713c249ae40aa1cf8862e091e8b745f5361"
+dependencies = [
+ "libredox",
+ "wasite 1.0.2",
"web-sys",
]
diff --git a/Cargo.toml b/Cargo.toml
index d9d8426c..919d8a92 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,7 @@ serde = { version = "1.0.202", features = ["derive"] }
serde_json = "1.0.119"
tokio = { version = "1", features = ["full"] }
uuid = { version = "1.9", features = ["v4", "v7", "serde"] }
-whoami = "1.5.1"
+whoami = "2.1.0"
typed-builder = "0.18.2"
pretty_assertions = "1.3.0"
thiserror = "1.0"
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.