Skip to content

Commit

Permalink
derive: don't write empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Aug 13, 2024
1 parent d459ca3 commit 8799f33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rinja_derive/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ impl Buffer {
const OPEN: &str = r#"writer.write_str(""#;
const CLOSE: &str = r#"")?;"#;

if !self.discard {
if !s.is_empty() && !self.discard {
if !self.last_was_write_str {
self.last_was_write_str = true;
self.buf.push_str(OPEN);
Expand Down

0 comments on commit 8799f33

Please sign in to comment.