MCPcopy Create free account
hub / github.com/Wulf/tsync / write_comments

Method write_comments

src/lib.rs:63–79  ·  view source on GitHub ↗
(&mut self, comments: &Vec<String>, indentation_amount: i8)

Source from the content-addressed store, hash-verified

61
62impl BuildState {
63 fn write_comments(&mut self, comments: &Vec<String>, indentation_amount: i8) {
64 let indentation = utils::build_indentation(indentation_amount);
65 match comments.len() {
66 0 => (),
67 1 => self
68 .types
69 .push_str(&format!("{}/** {} */\n", indentation, &comments[0])),
70 _ => {
71 self.types.push_str(&format!("{}/**\n", indentation));
72 for comment in comments {
73 self.types
74 .push_str(&format!("{} * {}\n", indentation, &comment))
75 }
76 self.types.push_str(&format!("{} */\n", indentation))
77 }
78 }
79 }
80}
81
82fn process_rust_item(item: syn::Item, state: &mut BuildState, config: &BuildSettings) {

Callers 8

convert_to_tsMethod · 0.80
convert_to_tsMethod · 0.80
convert_to_tsMethod · 0.80
process_fieldsFunction · 0.80
convert_to_tsMethod · 0.80
add_untagged_tagged_enumFunction · 0.80

Calls 1

build_indentationFunction · 0.85

Tested by

no test coverage detected