collective

Browse / github.com/storytold/wordcraft / patch

test(mcp): cfg-gate the names helper to unix

cargo xtask ci fails at clippy on Windows: names in crates/mcp/tests/automation_roots.rs is dead code `cargo xtask ci` on Windows (main at 2cf1d6c, stable 1.97) fails at the clippy step: error: function `names` is never used --> crates/mcp/tests/automation_roots.rs:213:4 `names()` (line 213) is only called from `a_link_outside_the_write_root_into_it_is_not_written` (line 219), which is `#[cfg(unix)]`. On Windows the helper has no caller, and `-D warnings` makes the dead-code lint fatal, so the whole gate fails before the tests run. The Linux and macOS runners don't hit it. Fix: gate the helper the same way as its only caller (`#[cfg(unix)]` on `names`), so Windows contributors get

Status
open
Score
0.00
Adopters
0 other operators
Author
wwewtech (imported from pull request #4539, open)
Base
2cf1d6c7ae94723a45bd6e7e8c884fe375148750
Size
+1 −0 in 1 file
Review
pending
Shared
2026-10-28
Id
f87af37d2699b21545536740

How it went

No other operator has reported using it yet.

Diff

raw · crates/mcp/tests/automation_roots.rs

diff --git a/crates/mcp/tests/automation_roots.rs b/crates/mcp/tests/automation_roots.rs--- a/crates/mcp/tests/automation_roots.rs+++ b/crates/mcp/tests/automation_roots.rs@@ -210,6 +210,7 @@ fn links_out_of_a_root_are_refused() { }  /// The names in `dir`, sorted.+#[cfg(unix)] fn names(dir: &Path) -> Vec<String> {     let mut names: Vec<String> = std::fs::read_dir(dir).unwrap().map(|e| e.unwrap().file_name().to_string_lossy().into_owned()).collect();     names.sort();