From bfeb62033adb8e628015ccfaed105ba4c1bc8eae Mon Sep 17 00:00:00 2001 From: Soispha Date: Wed, 27 Mar 2024 10:54:40 +0100 Subject: [PATCH] fix(macros/generate/convert/auxiliary/c/arguments): Accept newlines Multiple lines in one comment were not checked for, which resulted in only one `*` before instead of a new one after every `\n`. --- src/macros/generate/convert/auxiliary/c/attribute/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/macros/generate/convert/auxiliary/c/attribute/mod.rs b/src/macros/generate/convert/auxiliary/c/attribute/mod.rs index 5543b55..d1a0366 100644 --- a/src/macros/generate/convert/auxiliary/c/attribute/mod.rs +++ b/src/macros/generate/convert/auxiliary/c/attribute/mod.rs @@ -36,7 +36,14 @@ impl Attribute { .iter() .map(|attr| { if let Attribute::doc(doc_comment) = attr { - format!("*{}\n", doc_comment) + if doc_comment.is_empty() { + "*\n".to_owned() + } else { + doc_comment + .lines() + .map(|line| format!("*{}\n", line)) + .collect::() + } } else { attr.to_auxiliary_c() }