Merge pull request #1695 from Domanffe/chore/deslop

Cleanup: one predicate property helper, a Windows-only allow, tolerant locks in the bots
This commit is contained in:
Ludovic Marie
2026-10-25 14:10:57 +01:00
committed by GitHub
5 changed files with 47 additions and 47 deletions
+4
View File
@@ -181,12 +181,16 @@ pub fn java_runtime(
Ok(home)
}
// Used by the unix link step below; the path-traversal check itself is tested on every
// platform, so these stay compiled and are allowed to look unused elsewhere.
#[cfg_attr(not(unix), allow(dead_code))]
fn name_in<'a>(home: &Path, path: &'a Path) -> &'a Path {
path.strip_prefix(home).unwrap_or(path)
}
/// Whether a link at `link` (relative to the runtime's home) pointing at `target` stays in the
/// home.
#[cfg_attr(not(unix), allow(dead_code))]
fn link_stays_inside(link: &Path, target: &str) -> bool {
let mut depth = link.components().count().saturating_sub(1);
for c in Path::new(target).components() {