build: removed hostname, use whoami instead

whoami provides `hostname` function, so we don't need the hostname dependency, since whoami is also being used for getting the username

closes #398
This commit is contained in:
Christian Visintin
2026-04-19 01:54:46 +05:30
parent d97535894c
commit fe424107e9
3 changed files with 91 additions and 92 deletions
+1 -2
View File
@@ -49,11 +49,10 @@ impl FileTransferActivity {
let host_bridge_params = self.context().host_bridge_params().unwrap();
match host_bridge_params {
HostBridgeParams::Localhost(_) => {
let hostname = match hostname::get() {
let hostname = match whoami::hostname() {
Ok(h) => h,
Err(_) => return String::from("localhost"),
};
let hostname: String = hostname.as_os_str().to_string_lossy().to_string();
let tokens: Vec<&str> = hostname.split('.').collect();
String::from(*tokens.first().unwrap_or(&"localhost"))
}