refact: suppress warns on macos (#12449)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-08-18 15:09:11 +08:00
committed by GitHub
parent bf24869c6a
commit a22f2108c6
20 changed files with 150 additions and 82 deletions

View File

@@ -1,3 +1,5 @@
#[cfg(not(target_os = "ios"))]
use hbb_common::whoami;
use hbb_common::{
allow_err,
anyhow::bail,
@@ -10,7 +12,7 @@ use hbb_common::{
self,
sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
},
whoami, ResultType,
ResultType,
};
use std::{
@@ -45,7 +47,7 @@ pub(super) fn start_listening() -> ResultType<()> {
}
if let Some(self_addr) = get_ipaddr_by_peer(&addr) {
let mut msg_out = Message::new();
let mut hostname = whoami::hostname();
let mut hostname = crate::whoami_hostname();
// The default hostname is "localhost" which is a bit confusing
if hostname == "localhost" {
hostname = "unknown".to_owned();