Sean1708 / rusty-cheddar

A Rust crate for automatically generating C header files from Rust source file.
http://sean1708.github.io/rusty-cheddar/
191 stars 25 forks source link

Write comments and docstrings to the header file. #2

Closed Sean1708 closed 8 years ago

Sean1708 commented 8 years ago

Comments are a common form of documentation in header files so any rust docstrings should be written to the header file.

Should rust comments be written to the header file too?

Sean1708 commented 8 years ago

Mostly done, just need to indent them correctly now.

Sean1708 commented 8 years ago

My suggestion would be to have a function signature of

fn retrieve_docstring(attr: &Attribute, prepend: &str) -> String {

and call it with a closure

let (_, docs) = parse_attr(&var.node.attrs, |_| true, |attr| retrieve_docstring(attr, "\t"));