in avro_derive/src/lib.rs [327:351]
fn extract_outer_doc(attributes: &[Attribute]) -> Option<String> {
let doc = attributes
.iter()
.filter(|attr| attr.style == AttrStyle::Outer && attr.path().is_ident("doc"))
.filter_map(|attr| {
let name_value = attr.meta.require_name_value();
match name_value {
Ok(name_value) => match &name_value.value {
syn::Expr::Lit(expr_lit) => match expr_lit.lit {
syn::Lit::Str(ref lit_str) => Some(lit_str.value().trim().to_string()),
_ => None,
},
_ => None,
},
Err(_) => None,
}
})
.collect::<Vec<String>>()
.join("\n");
if doc.is_empty() {
None
} else {
Some(doc)
}
}