fix(core): Windows 上 clippy 报 discover.rs 两个 cfg(unix) 测试导入未使用

这两个 Termux 扫描用例挂着 `#[cfg(unix)]`,但它们的 `use`(`standard_roots_in`、
`platform::paths::MapEnv`)写在 mod tests 顶部没跟着 gate:

- Termux/Linux 上 cfg(unix) 成立 → 有用例 → 导入有使用者 → clippy 干净(作者本机 475 测试
  通过是真的);
- Windows 上那两个用例不编译 → 导入无使用者 → `-D warnings` 直接判错
  (`unused import` ×2,`could not compile unlucky-core (lib test)`)。

把两个 `use` 同样 gate 成 `#[cfg(unix)]`。代价是这两个用例在 Windows 上不编译不执行,
覆盖由 Linux CI 承担(它们断言的本来就是 Unix 路径)。
This commit is contained in:
AskaEth committed 2026-11-07 09:33:23 +08:00
1 parent 161aec52f4
commit c82e39d0eb
1 file changed
+6 -1
+6 -1
View File
@@ -225,8 +225,13 @@ pub fn path_key(path: &Path) -> String {
#[cfg(test)]
mod tests {
use super::{dedupe, parse_java_home, path_key, standard_roots, standard_roots_in};
use super::{dedupe, parse_java_home, path_key, standard_roots};
use crate::game::java::probe::{JavaOrigin, JavaRuntime};
// 这两个只有 Termux 扫描的两个测试用,而那两个测试是 `cfg(unix)`——导入必须同样 gate,
// 否则 Windows 上不编译测试、导入就成了未使用(`-D warnings` 直接判错)。
#[cfg(unix)]
use super::standard_roots_in;
#[cfg(unix)]
use crate::platform::paths::MapEnv;
fn runtime(path: &str, origin: JavaOrigin) -> JavaRuntime {