fix: build (#11611)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-04-30 23:49:18 +08:00
committed by GitHub
parent 83aae23ba6
commit 20fcddffbd
10 changed files with 17 additions and 17 deletions

View File

@@ -2335,7 +2335,7 @@ impl LoginConfigHandler {
.collect::<Vec<_>>()
.join(" ");
#[cfg(not(target_os = "android"))]
let my_platform = whoami::platform().to_string();
let my_platform = hbb_common::whoami::platform().to_string();
#[cfg(target_os = "android")]
let my_platform = "Android".into();
let hwid = if self.get_option("trust-this-device") == "Y" {

View File

@@ -463,7 +463,7 @@ pub fn is_support_multi_clipboard(peer_version: &str, peer_platform: &str) -> bo
if get_version_number(peer_version) < get_version_number("1.3.0") {
return false;
}
if ["", &whoami::Platform::Ios.to_string()].contains(&peer_platform) {
if ["", &hbb_common::whoami::Platform::Ios.to_string()].contains(&peer_platform) {
return false;
}
if "Android" == peer_platform && get_version_number(peer_version) < get_version_number("1.3.3")

View File

@@ -7,6 +7,8 @@ use std::{
use serde_json::{json, Map, Value};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use hbb_common::whoami;
use hbb_common::{
allow_err,
anyhow::{anyhow, Context},

View File

@@ -1,7 +1,7 @@
use hbb_common::config::Config;
use hbb_common::{
allow_err,
anyhow::bail,
config::Config,
config::{self, RENDEZVOUS_PORT},
log,
protobuf::Message as _,
@@ -10,7 +10,7 @@ use hbb_common::{
self,
sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
},
ResultType,
whoami, ResultType,
};
use std::{

View File

@@ -1089,7 +1089,7 @@ mod desktop {
}
self.display = self
.display
.replace(&whoami::hostname(), "")
.replace(&hbb_common::whoami::hostname(), "")
.replace("localhost", "");
}

View File

@@ -1268,8 +1268,8 @@ impl Connection {
#[cfg(not(target_os = "android"))]
{
pi.hostname = whoami::hostname();
pi.platform = whoami::platform().to_string();
pi.hostname = hbb_common::whoami::hostname();
pi.platform = hbb_common::whoami::platform().to_string();
}
#[cfg(target_os = "android")]
{
@@ -1314,13 +1314,13 @@ impl Connection {
#[cfg(any(target_os = "windows", feature = "unix-file-copy-paste"))]
{
let is_both_windows = cfg!(target_os = "windows")
&& self.lr.my_platform == whoami::Platform::Windows.to_string();
&& self.lr.my_platform == hbb_common::whoami::Platform::Windows.to_string();
#[cfg(feature = "unix-file-copy-paste")]
let is_unix_and_peer_supported = crate::is_support_file_copy_paste(&self.lr.version);
#[cfg(not(feature = "unix-file-copy-paste"))]
let is_unix_and_peer_supported = false;
let is_both_macos = cfg!(target_os = "macos")
&& self.lr.my_platform == whoami::Platform::MacOS.to_string();
&& self.lr.my_platform == hbb_common::whoami::Platform::MacOS.to_string();
let is_peer_support_paste_if_macos =
crate::is_support_file_paste_if_macos(&self.lr.version);
let has_file_clipboard = is_both_windows
@@ -4279,7 +4279,7 @@ mod raii {
) -> Self {
let printer = conn_type == crate::server::AuthConnType::Remote
&& crate::is_support_remote_print(&lr.version)
&& lr.my_platform == whoami::Platform::Windows.to_string();
&& lr.my_platform == hbb_common::whoami::Platform::Windows.to_string();
AUTHED_CONNS.lock().unwrap().push(AuthedConn {
conn_id,
conn_type,

View File

@@ -29,7 +29,7 @@ use hbb_common::{
sync::mpsc,
time::{Duration as TokioDuration, Instant},
},
Stream,
whoami, Stream,
};
use crate::client::io_loop::Remote;