diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-04-12 21:27:34 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2026-04-12 21:27:34 +0800 |
| commit | b33c2f991fa835049dfd8aa6d9ef621ac36d55d3 (patch) | |
| tree | 9a67e409135ec25f904fcc1e61d4c7c00c428905 /dev_tools | |
| parent | 0e0423ec631371c04e8e8afa18aa57886f7de53b (diff) | |
Trim trailing whitespace in generated examples file
Diffstat (limited to 'dev_tools')
| -rw-r--r-- | dev_tools/src/bin/refresh-examples.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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::<Vec<_>>() + .join("\n") + + "\n"; + std::fs::write(repo_root.join(OUTPUT_PATH), template_str).unwrap(); } fn find_git_repo() -> Option<std::path::PathBuf> { |
