let num_doc_attrs = attrs
.iter()
.filter(|attr| attr.path().is_ident("doc"))
.count();
if !self.ignore_extra_doc_attributes && num_doc_attrs > 1 {
panic!("Multi-line comments are disabled by default by displaydoc. Please consider using block doc comments (/** */) or adding the #[ignore_extra_doc_attributes] attribute to your type next to the derive.");
}
for attr in attrs { if attr.path().is_ident("doc") { let lit = match &attr.meta {
Meta::NameValue(syn::MetaNameValue {
value:
syn::Expr::Lit(syn::ExprLit {
lit: syn::Lit::Str(lit),
..
}),
..
}) => lit,
_ => unimplemented!(),
};
// Make an attempt at cleaning up multiline doc comments. let doc_str = lit
.value()
.lines()
.map(|line| line.trim().trim_start_matches('*').trim())
.collect::<Vec<&str>>()
.join("\n");
let lit = LitStr::new(doc_str.trim(), lit.span());
pub(crate) fn display_with_input(
&self,
r#enum: &[Attribute],
variant: &[Attribute],
) -> Result<Option<VariantDisplay>> { let r#enum = ifself.prefix_enum_doc_attributes { let result = self
.display(r#enum)?
.expect("Missing doc comment on enum with #[prefix_enum_doc_attributes]. Please remove the attribute or add a doc comment to the enum itself.");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.