diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-02 22:10:44 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-02 22:10:44 +0800 |
| commit | 8d6b68804768e873e6627b61fd34a551bf4090e6 (patch) | |
| tree | 4ae0ec9af2b9bbd7fe286d2a24b64066de43595f /src/expand.rs | |
| parent | 8f1cf091f62a36e30b8cf3e97b0de7eaec58e1bf (diff) | |
Fix empty impl block generating unnecessary newlines
Diffstat (limited to 'src/expand.rs')
| -rw-r--r-- | src/expand.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expand.rs b/src/expand.rs index 049b04d..5933b2c 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -135,8 +135,10 @@ fn apply_impls( continue; }; - applied_content += "\n"; - applied_content += impled_code.join("\n").as_str(); + if impled_code.len() > 0 { + applied_content += "\n"; + applied_content += impled_code.join("\n").as_str(); + } } else { // Other content directly appended applied_content += "\n"; |
