a73x

dab3c54c

Add comment explaining Box::leak in build script

a73x   2026-03-21 09:44

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

diff --git a/build.rs b/build.rs
index 518588b..5a934da 100644
--- a/build.rs
+++ b/build.rs
@@ -29,6 +29,7 @@ fn generate_manpages(cmd: &clap::Command, out: &PathBuf) {
            continue;
        }
        let sub_name = format!("{}-{}", cmd.get_name(), sub.get_name());
        // Leak is fine: build scripts are short-lived processes. clap requires 'static str for name().
        let sub_name: &'static str = Box::leak(sub_name.into_boxed_str());
        let sub_cmd = sub.clone().name(sub_name);
        generate_manpages(&sub_cmd, out);