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

@@ -254,7 +254,7 @@ fn update_daemon_agent(agent_plist_file: String, update_source_dir: String, sync
let func = move || {
let mut binding = std::process::Command::new("osascript");
let mut cmd = binding
let cmd = binding
.arg("-e")
.arg(update_script_body)
.arg(daemon_plist_body)
@@ -876,6 +876,7 @@ pub fn hide_dock() {
}
#[inline]
#[allow(dead_code)]
fn get_server_start_time_of(p: &Process, path: &Path) -> Option<i64> {
let cmd = p.cmd();
if cmd.len() <= 1 {
@@ -894,6 +895,7 @@ fn get_server_start_time_of(p: &Process, path: &Path) -> Option<i64> {
}
#[inline]
#[allow(dead_code)]
fn get_server_start_time(sys: &mut System, path: &Path) -> Option<(i64, Pid)> {
sys.refresh_processes_specifics(ProcessRefreshKind::new());
for (_, p) in sys.processes() {

View File

@@ -119,16 +119,18 @@ pub fn get_wakelock(_display: bool) -> WakeLock {
return crate::platform::WakeLock::new(_display, true, false);
}
#[cfg(any(target_os = "windows", target_os = "linux"))]
pub(crate) struct InstallingService; // please use new
#[cfg(any(target_os = "windows", target_os = "linux"))]
impl InstallingService {
#[cfg(any(target_os = "windows", target_os = "linux"))]
pub fn new() -> Self {
*INSTALLING_SERVICE.lock().unwrap() = true;
Self
}
}
#[cfg(any(target_os = "windows", target_os = "linux"))]
impl Drop for InstallingService {
fn drop(&mut self) {
*INSTALLING_SERVICE.lock().unwrap() = false;
@@ -144,6 +146,7 @@ pub fn is_prelogin() -> bool {
// Note: This method is inefficient on Windows. It will get all the processes.
// It should only be called when performance is not critical.
// If we wanted to get the command line ourselves, there would be a lot of new code.
#[allow(dead_code)]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
fn get_pids_of_process_with_args<S1: AsRef<str>, S2: AsRef<str>>(
name: S1,