feat: switch to hostname crate for full hostname resolution
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
use gethostname::gethostname;
|
|
||||||
use crate::meta_plugin::MetaPlugin;
|
use crate::meta_plugin::MetaPlugin;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default)]
|
||||||
@@ -49,11 +48,16 @@ impl HostnameMetaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_hostname(&self) -> String {
|
fn get_hostname(&self) -> String {
|
||||||
match gethostname().into_string() {
|
match hostname::get() {
|
||||||
|
Ok(hostname_os) => {
|
||||||
|
match hostname_os.into_string() {
|
||||||
Ok(hostname) => hostname,
|
Ok(hostname) => hostname,
|
||||||
Err(_) => "unknown".to_string(),
|
Err(_) => "unknown".to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Err(_) => "unknown".to_string(),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MetaPlugin for HostnameMetaPlugin {
|
impl MetaPlugin for HostnameMetaPlugin {
|
||||||
|
|||||||
Reference in New Issue
Block a user