From 8d6b68804768e873e6627b61fd34a551bf4090e6 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 2 Mar 2026 22:10:44 +0800 Subject: Bump version to 0.1.3 Fix empty impl block generating unnecessary newlines --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/expand.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4124f8..42ac6be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "5454cda0d57db59778608d7a47bff5b16c6705598265869fb052b657f66cf05e" [[package]] name = "just_template" -version = "0.1.2" +version = "0.1.3" dependencies = [ "just_fmt", ] diff --git a/Cargo.toml b/Cargo.toml index 42e6c3c..63f61e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "just_template" authors = ["Weicao-CatilGrass"] description = "a tool for code gen via templates" -version = "0.1.2" +version = "0.1.3" edition = "2024" readme = "README.md" 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"; -- cgit