From ea48cc8b697b184592b6bf7ad883bd147ad749a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:41:27 +0000 Subject: [PATCH 1/3] Initial plan From 157e7451b775dc3728cad2b013cc1e92dc3a27de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:47:01 +0000 Subject: [PATCH 2/3] Fix symlink detection in files_with_predicate function Co-authored-by: twistedfall <406037+twistedfall@users.noreply.github.com> --- build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 025a76cb..aa5836d7 100644 --- a/build.rs +++ b/build.rs @@ -85,7 +85,11 @@ fn files_with_predicate<'p>( Ok(dir .read_dir()? .flatten() - .filter_map(|e| e.file_type().is_ok_and(|typ| typ.is_file()).then(|| e.path())) + .filter_map(|e| { + let path = e.path(); + // Use path.metadata() instead of e.file_type() to follow symlinks + path.metadata().ok().filter(|m| m.is_file()).map(|_| path) + }) .filter(move |p| predicate(p))) } From 2072ad27454b4282ec59f0649d878344220e8618 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 14:05:44 +0000 Subject: [PATCH 3/3] Refactor to use is_ok_and + then pattern as requested Co-authored-by: twistedfall <406037+twistedfall@users.noreply.github.com> --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index aa5836d7..163c021b 100644 --- a/build.rs +++ b/build.rs @@ -88,7 +88,7 @@ fn files_with_predicate<'p>( .filter_map(|e| { let path = e.path(); // Use path.metadata() instead of e.file_type() to follow symlinks - path.metadata().ok().filter(|m| m.is_file()).map(|_| path) + path.metadata().is_ok_and(|m| m.is_file()).then(|| path) }) .filter(move |p| predicate(p))) }