pub fn parse(attrs: &[syn::Attribute]) -> Option<Vec<String>> {
let doc_strings: Vec<String> = attrs
.iter()
.filter_map(|attr| {
if let syn::Meta::NameValue(meta) = &attr.meta {
if meta.path.is_ident("doc") {
if let syn::Expr::Lit(expr_lit) = &meta.value {
if let syn::Lit::Str(doc) = &expr_lit.lit {
let val = doc.value().trim().to_string();
if val.starts_with("CHECK:") {
return None;
}
return Some(val);
}
}
}
}
None
})
.collect();
if doc_strings.is_empty() {
None
} else {
Some(doc_strings)
}
}