Skip to content

Commit c4a47e1

Browse files
authored
Refactor text collection in collect_text function
1 parent 9f1fe99 commit c4a47e1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

autorust/codegen/src/config_parser.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ mod literate_config {
186186
// from https://github.com/kivikakk/comrak/blob/main/examples/headers.rs
187187
fn collect_text<'a>(node: &'a AstNode<'a>, output: &mut String) {
188188
match node.data.borrow().value {
189-
NodeValue::Text(ref literal) | NodeValue::Code(NodeCode { ref literal, .. }) => {
190-
output.push_str(literal)
189+
NodeValue::Text(ref literal) => {
190+
output.push_str(literal.as_ref())
191+
}
192+
NodeValue::Code(NodeCode { ref literal, .. }) => {
193+
output.push_str(literal.as_ref())
191194
}
192195
NodeValue::LineBreak | NodeValue::SoftBreak => output.push(' '),
193196
_ => {

0 commit comments

Comments
 (0)