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

@@ -178,6 +178,7 @@ pub enum AuthConnType {
#[derive(Clone, Debug)]
enum TerminalUserToken {
SelfUser,
#[cfg(target_os = "windows")]
CurrentLogonUser(crate::terminal_service::UserToken),
}
@@ -186,6 +187,7 @@ impl TerminalUserToken {
fn to_terminal_service_token(&self) -> Option<crate::terminal_service::UserToken> {
match self {
TerminalUserToken::SelfUser => None,
#[cfg(target_os = "windows")]
TerminalUserToken::CurrentLogonUser(token) => Some(*token),
}
}
@@ -1318,7 +1320,7 @@ impl Connection {
#[cfg(not(target_os = "android"))]
{
pi.hostname = hbb_common::whoami::hostname();
pi.hostname = crate::whoami_hostname();
pi.platform = hbb_common::whoami::platform().to_string();
}
#[cfg(target_os = "android")]
@@ -3314,6 +3316,7 @@ impl Connection {
{
return;
}
#[allow(unused_mut)]
let mut record_changed = true;
#[cfg(windows)]
if virtual_display_manager::amyuni_idd::is_my_display(&name) {
@@ -3935,7 +3938,6 @@ impl Connection {
#[cfg(feature = "unix-file-copy-paste")]
async fn handle_file_clip(&mut self, clip: clipboard::ClipboardFile) {
let is_stopping_allowed = clip.is_stopping_allowed();
let is_keyboard_enabled = self.peer_keyboard_enabled();
let file_transfer_enabled = self.file_transfer_enabled();
let stop = is_stopping_allowed && !file_transfer_enabled;
log::debug!(
@@ -4626,6 +4628,7 @@ mod raii {
.send((conn_count, remote_count)));
}
#[cfg(windows)]
pub fn non_port_forward_conn_count() -> usize {
AUTHED_CONNS
.lock()