From 3f9e485b7d6f253ea0490e0ab083f3009b763a89 Mon Sep 17 00:00:00 2001 From: Virgile P <222121099+Virgile-pct@users.noreply.github.com> Date: Mon, 23 Nov 2026 11:36:27 +0100 Subject: [PATCH] Keep skippy-serving's test build warning-free on Windows Every test in telemetry/resource_usage.rs is gated on macOS or Linux, so on Windows the test module only held an unused use super::*, and cargo clippy -p skippy-serving --all-targets -- -D warnings failed. The gate moves onto the module. Ported from Mesh-LLM/mesh-llm#3167. --- crates/skippy-serving/src/telemetry/resource_usage.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/skippy-serving/src/telemetry/resource_usage.rs b/crates/skippy-serving/src/telemetry/resource_usage.rs index 490dde82..719d4e41 100644 --- a/crates/skippy-serving/src/telemetry/resource_usage.rs +++ b/crates/skippy-serving/src/telemetry/resource_usage.rs @@ -260,12 +260,13 @@ mod platform { } } -#[cfg(test)] +// Every test reads a macOS or Linux source, so on other targets the module +// would only hold an unused import. +#[cfg(all(test, any(target_os = "macos", target_os = "linux")))] mod tests { use super::*; #[test] - #[cfg(any(target_os = "macos", target_os = "linux"))] fn this_process_has_cpu_time_and_resident_memory() { let usage = process_usage().expect("process usage"); assert!(usage.resident_bytes > 0); @@ -279,7 +280,6 @@ mod tests { } #[test] - #[cfg(any(target_os = "macos", target_os = "linux"))] fn the_system_reports_total_and_free_memory() { let memory = system_memory().expect("system memory"); assert!(memory.total_bytes > 0);