Remove spotlight for trait aliases and fix nits

This commit is contained in:
Guillaume Gomez 2019-02-10 16:56:21 +01:00
parent c20357a62a
commit b1d82ac6ed
3 changed files with 3 additions and 6 deletions

View File

@ -1899,13 +1899,11 @@ fn clean(&self, cx: &DocContext) -> Item {
pub struct TraitAlias {
pub generics: Generics,
pub bounds: Vec<GenericBound>,
pub is_spotlight: bool,
}
impl Clean<Item> for doctree::TraitAlias {
fn clean(&self, cx: &DocContext) -> Item {
let attrs = self.attrs.clean(cx);
let is_spotlight = attrs.has_doc_flag("spotlight");
Item {
name: Some(self.name.clean(cx)),
attrs,
@ -1917,7 +1915,6 @@ fn clean(&self, cx: &DocContext) -> Item {
inner: TraitAliasItem(TraitAlias {
generics: self.generics.clean(cx),
bounds: self.bounds.clean(cx),
is_spotlight,
}),
}
}

View File

@ -1925,7 +1925,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
print_entries(f, &self.derives, "Derive Macros", "derives")?;
print_entries(f, &self.functions, "Functions", "functions")?;
print_entries(f, &self.typedefs, "Typedefs", "typedefs")?;
print_entries(f, &self.trait_aliases, "Trait Aliases", "trait-alias")?;
print_entries(f, &self.trait_aliases, "Trait Aliases", "trait-aliases")?;
print_entries(f, &self.existentials, "Existentials", "existentials")?;
print_entries(f, &self.statics, "Statics", "statics")?;
print_entries(f, &self.constants, "Constants", "constants")
@ -4863,7 +4863,7 @@ fn item_ty_to_strs(ty: &ItemType) -> (&'static str, &'static str) {
ItemType::Existential => ("existentials", "Existentials"),
ItemType::ProcAttribute => ("attributes", "Attribute Macros"),
ItemType::ProcDerive => ("derives", "Derive Macros"),
ItemType::TraitAlias => ("trait-alias", "Trait aliases"),
ItemType::TraitAlias => ("trait-aliases", "Trait aliases"),
}
}

View File

@ -8,7 +8,7 @@
// @has foo/all.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
// @has foo/all.html '//a[@href="traitalias.Foo.html"]' 'Foo'
// @has foo/index.html '//h2[@id="trait-alias"]' 'Trait aliases'
// @has foo/index.html '//h2[@id="trait-aliases"]' 'Trait aliases'
// @has foo/index.html '//a[@class="traitalias"]' 'CopyAlias'
// @has foo/index.html '//a[@class="traitalias"]' 'Alias2'
// @has foo/index.html '//a[@class="traitalias"]' 'Foo'