From b33c2f991fa835049dfd8aa6d9ef621ac36d55d3 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sun, 12 Apr 2026 21:27:34 +0800 Subject: Trim trailing whitespace in generated examples file --- dev_tools/src/bin/refresh-examples.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'dev_tools') diff --git a/dev_tools/src/bin/refresh-examples.rs b/dev_tools/src/bin/refresh-examples.rs index c341bc4..be5da82 100644 --- a/dev_tools/src/bin/refresh-examples.rs +++ b/dev_tools/src/bin/refresh-examples.rs @@ -118,7 +118,14 @@ fn main() { }); } - std::fs::write(repo_root.join(OUTPUT_PATH), template.to_string()).unwrap(); + let template_str = template.to_string(); + let template_str = template_str + .lines() + .map(|line| line.trim_end()) + .collect::>() + .join("\n") + + "\n"; + std::fs::write(repo_root.join(OUTPUT_PATH), template_str).unwrap(); } fn find_git_repo() -> Option { -- cgit