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>)
| 168 | /// note: the compiler transforms doc comments into attributes |
| 169 | /// see: https://docs.rs/syn/2.0.28/syn/struct.Attribute.html#doc-comments |
| 170 | pub 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`. |
no outgoing calls
no test coverage detected