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`.
This commit is contained in:
Benedikt Peetz 2024-03-27 10:54:40 +01:00
parent a66c687421
commit bfeb62033a
Signed by: bpeetz
GPG Key ID: A5E94010C3A642AD
1 changed files with 8 additions and 1 deletions

View File

@ -36,7 +36,14 @@ impl Attribute {
.iter() .iter()
.map(|attr| { .map(|attr| {
if let Attribute::doc(doc_comment) = 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::<String>()
}
} else { } else {
attr.to_auxiliary_c() attr.to_auxiliary_c()
} }