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

Function get_comments

src/utils.rs:170–179  ·  view source on GitHub ↗

Get the doc string comments from the syn::attributes note: the compiler transforms doc comments into attributes see: https://docs.rs/syn/2.0.28/syn/struct.Attribute.html#doc-comments

(mut attributes: Vec<syn::Attribute>)

Source from the content-addressed store, hash-verified

168/// note: the compiler transforms doc comments into attributes
169/// see: https://docs.rs/syn/2.0.28/syn/struct.Attribute.html#doc-comments
170pub fn get_comments(mut attributes: Vec<syn::Attribute>) -> Vec<String> {
171 // Retains only attributes that have segments equal to "doc".
172 // (.e.g. #[doc = "Single line doc comments"])
173 attributes.retain(|x| x.path().segments.iter().any(|seg| seg.ident == "doc"));
174
175 attributes
176 .iter()
177 .flat_map(check_doc_attribute)
178 .collect::<Vec<String>>()
179}
180
181/// Generate a string filled with `indentation_amount` white-space
182/// literal `chars`.

Callers 8

convert_to_tsMethod · 0.85
convert_to_tsMethod · 0.85
convert_to_tsMethod · 0.85
process_fieldsFunction · 0.85
convert_to_tsMethod · 0.85
add_untagged_tagged_enumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected