diff --git a/src/doc.rs b/src/doc.rs index ddc5b2d..4c07d03 100644 --- a/src/doc.rs +++ b/src/doc.rs @@ -243,37 +243,6 @@ impl ItemType { } } - pub fn class(&self) -> &str { - match self { - ItemType::Module => "module", - ItemType::ExternCrate => "extern-crate", - ItemType::Import => "import", - ItemType::Struct => "struct", - ItemType::Enum => "enum", - ItemType::Function => "function", - ItemType::Typedef => "type", - ItemType::Static => "static", - ItemType::Trait => "trait", - ItemType::Impl => "impl", - ItemType::TyMethod => "required-method", - ItemType::Method => "method", - ItemType::StructField => "structfield", - ItemType::Variant => "variant", - ItemType::Macro => "macro", - ItemType::Primitive => "primitive", - ItemType::AssocType => "associated-type", - ItemType::Constant => "constant", - ItemType::AssocConst => "associated-const", - ItemType::Union => "union", - ItemType::ForeignType => "foreign-type", - ItemType::Keyword => "keyword", - ItemType::OpaqueTy => "opaque-type", - ItemType::ProcAttribute => "proc-attribute", - ItemType::ProcDerive => "proc-derive", - ItemType::TraitAlias => "trait-alias", - } - } - pub fn group_name(&self) -> &str { match self { ItemType::Module => "Modules", diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 1180801..3472285 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -275,7 +275,7 @@ fn get_fields( let mut definition: Option = None; while let Some(element) = &next { - if element.is_element(&local_name!("span")) && element.has_class(ty.class()) { + if element.is_element(&local_name!("span")) && element.has_class("structfield") { fields.push(&mut name, &mut definition, None)?; name = get_id_part(element, 1); definition = Some(element.into()); @@ -476,7 +476,7 @@ fn get_variants( let mut definition: Option = None; while let Some(element) = &next { if element.is_element(&local_name!("div")) { - if element.has_class(ty.class()) { + if element.has_class("variant") { variants.push(&mut name, &mut definition, None)?; name = get_id_part(element, 1); definition = Some(element.into());