Skip to content

Commit 5573e52

Browse files
committed
Emit docs on struct fields into generated C++ code
1 parent 3fab70e commit 5573e52

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gen/src/write.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ fn write_struct<'a>(out: &mut OutFile<'a>, strct: &'a Struct, methods: &[&Extern
233233
writeln!(out, "struct {} final {{", strct.name.cxx);
234234

235235
for field in &strct.fields {
236+
for line in field.doc.to_string().lines() {
237+
writeln!(out, " //{}", line);
238+
}
236239
write!(out, " ");
237240
write_type_space(out, &field.ty);
238241
writeln!(out, "{};", field.ident);

0 commit comments

Comments
 (0)