fix(m291): 守卫文档在 400 行内收(⑧ 并入 ⑦ 段,净增 0 行),make_dir_link 可见性收窄到 pub(super)(M291 r1)

This commit is contained in:
AskaEth committed 2026-11-13 00:48:38 +08:00
1 parent 375cc4f1fa
commit 7d16317411
2 files changed
+7 -13

No files matched your search

+3 -3
View File
@@ -136,13 +136,13 @@ pub(in crate::host) fn key_of(path: &Path) -> String {
///
/// 模块级而不是 `mod tests` 里,因为 [`super::tests_multiroot`] 的判据②也要造链接(M291):两处
/// 各写一份一字不差的 `cmd /c mklink /J` 只是把同一个坑埋两遍,`child_quiet_guard` 也是一次抓两处。
/// 可见性只开到 `crate::host`——调用方就这两个用例模块。
/// 可见性只开到 `super`(`host::game`)——两个调用方都是它的直接子模块。
///
/// 走 [`unlucky_core::platform::child::quiet`]:本仓库的 exe 是 GUI 程序(PE Subsystem = 2),
/// spawn `cmd.exe` 这种控制台程序时 Windows 会新开一块控制台(桌面上「黑框闪一下」)。
/// 语义不变:只看退出码(`.status()`),不读输出,失败一律 `false`。
#[cfg(all(test, windows))]
pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool {
pub(super) fn make_dir_link(link: &Path, target: &Path) -> bool {
unlucky_core::platform::child::quiet("cmd")
.args(["/c", "mklink", "/J"])
.arg(link)
@@ -153,7 +153,7 @@ pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool {
}
#[cfg(all(test, not(windows)))]
pub(in crate::host) fn make_dir_link(link: &Path, target: &Path) -> bool {
pub(super) fn make_dir_link(link: &Path, target: &Path) -> bool {
std::os::unix::fs::symlink(target, link).is_ok()
}