8000 fmt: fix trailing comment in #801 · rune-rs/rune@233decb · GitHub
[go: up one dir, main page]

Skip to content

Commit 233decb

Browse files
committed
fmt: fix trailing comment in #801
1 parent 4782836 commit 233decb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

crates/rune/src/fmt/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ fn exprs_loose<'a>(fmt: &mut Formatter<'a>, p: &mut Stream<'a>) -> Result<()> {
805805
}
806806

807807
fmt.nl(1)?;
808+
fmt.comments(Line)?;
808809
fmt.indent(-1)?;
809810
Ok(())
810811
}

crates/rune/src/fmt/tests/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ fn keep_trailing_comments() {
8383
}
8484
"#
8585
);
86+
87+
assert_format!(
88+
r#"
89+
const DOVECOT_UNCHANGED = [
90+
//("dovecot-core", "dovecot-db.conf.ext"),
91+
("dovecot-core", "dovecot-dict-auth.conf.ext"),
92+
("dovecot-core", "dovecot-dict-sql.conf.ext"),
93+
("dovecot-core", "dovecot-sql.conf.ext"),
94+
//("dovecot-core", "dovecot.conf"),
95+
];
96+
"#
97+
);
8698
}
8799

88100
#[test]

0 commit comments

Comments
 (0)
0