mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-03 14:51:28 +03:00
refact: suppress warns on macos (#12449)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@ use std::{
|
||||
|
||||
use serde_json::{json, Map, Value};
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
use hbb_common::whoami;
|
||||
use hbb_common::{
|
||||
allow_err,
|
||||
@@ -776,12 +776,22 @@ pub fn username() -> String {
|
||||
return DEVICE_NAME.lock().unwrap().clone();
|
||||
}
|
||||
|
||||
// Exactly the implementation of "whoami::hostname()".
|
||||
// This wrapper is to suppress warnings.
|
||||
#[inline(always)]
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
pub fn whoami_hostname() -> String {
|
||||
let mut hostname = whoami::fallible::hostname().unwrap_or_else(|_| "localhost".to_string());
|
||||
hostname.make_ascii_lowercase();
|
||||
hostname
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn hostname() -> String {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
{
|
||||
#[allow(unused_mut)]
|
||||
let mut name = whoami::hostname();
|
||||
let mut name = whoami_hostname();
|
||||
// some time, there is .local, some time not, so remove it for osx
|
||||
#[cfg(target_os = "macos")]
|
||||
if name.ends_with(".local") {
|
||||
@@ -1723,7 +1733,7 @@ pub fn is_custom_client() -> bool {
|
||||
get_app_name() != "RustDesk"
|
||||
}
|
||||
|
||||
pub fn verify_login(raw: &str, id: &str) -> bool {
|
||||
pub fn verify_login(_raw: &str, _id: &str) -> bool {
|
||||
true
|
||||
/*
|
||||
if is_custom_client() {
|
||||
|
||||
Reference in New Issue
Block a user