From d0d413281b604eed5fe00a83b8b17f6609923720 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Tue, 6 Oct 2026 11:45:33 +0800 Subject: [PATCH] fix(build): eliminate unused import and dead code warnings on Unix --- apps/gpservice/src/hip_source.rs | 4 ++-- crates/gpapi/src/session/network/bsd_routes.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/gpservice/src/hip_source.rs b/apps/gpservice/src/hip_source.rs index 8b7bba9..76f2acd 100644 --- a/apps/gpservice/src/hip_source.rs +++ b/apps/gpservice/src/hip_source.rs @@ -1,6 +1,6 @@ use std::{fs, io, os::unix::fs::PermissionsExt, path::PathBuf, sync::Arc}; -use anyhow::{Context, bail, ensure}; +use anyhow::{Context, ensure}; use gpapi::{ hip::HipSource, os_profile::{ClientOs, HostIdentity, OsProfile, OsProfileBuilder}, @@ -103,7 +103,7 @@ pub(crate) fn resolve( #[cfg(not(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd")))] { let _ = (approval_id, desktop_uid); - bail!("Root HIP script approvals are unavailable on this platform") + anyhow::bail!("Root HIP script approvals are unavailable on this platform") } } }; diff --git a/crates/gpapi/src/session/network/bsd_routes.rs b/crates/gpapi/src/session/network/bsd_routes.rs index e9e001a..9057c44 100644 --- a/crates/gpapi/src/session/network/bsd_routes.rs +++ b/crates/gpapi/src/session/network/bsd_routes.rs @@ -1,5 +1,6 @@ use super::*; +#[cfg(any(target_os = "freebsd", target_os = "openbsd", target_os = "macos"))] pub(super) fn routes(control: &dyn CollectionControl) -> anyhow::Result> { let mut routes = Vec::new(); for family in ["inet", "inet6"] {