",
);
for implementor in concrete {
@@ -1043,10 +1040,11 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
w.write_str("
");
if t.is_auto(tcx) {
- write_small_section_header(
+ write_section_heading(
w,
- "synthetic-implementors",
"Auto implementors",
+ "synthetic-implementors",
+ None,
"",
);
for implementor in synthetic {
@@ -1064,18 +1062,20 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
} else {
// even without any implementations to write in, we still want the heading and list, so the
// implementors javascript file pulled in below has somewhere to write the impls into
- write_small_section_header(
+ write_section_heading(
w,
- "implementors",
"Implementors",
+ "implementors",
+ None,
"
",
);
if t.is_auto(tcx) {
- write_small_section_header(
+ write_section_heading(
w,
- "synthetic-implementors",
"Auto implementors",
+ "synthetic-implementors",
+ None,
"
",
);
}
@@ -1258,11 +1258,7 @@ fn item_type_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &c
write!(w, "{}", document(cx, it, None, HeadingOffset::H2));
if let Some(inner_type) = &t.inner_type {
- write!(
- w,
- ""
- );
+ write_section_heading(w, "Aliased Type", "aliased-type", None, "");
match inner_type {
clean::TypeAliasInnerType::Enum { variants, is_non_exhaustive } => {
@@ -1683,16 +1679,14 @@ fn item_variants(
enum_def_id: DefId,
) {
let tcx = cx.tcx();
- write!(
+ write_section_heading(
w,
- "
\
- Variants{}§\
-
\
- {}\
-
",
- document_non_exhaustive_header(it),
- document_non_exhaustive(it)
+ &format!("Variants{}", document_non_exhaustive_header(it)),
+ "variants",
+ Some("variants"),
+ format!("{}
", document_non_exhaustive(it)),
);
+
let should_show_enum_discriminant = should_show_enum_discriminant(cx, enum_def_id, variants);
for (index, variant) in variants.iter_enumerated() {
if variant.is_stripped() {
@@ -1933,16 +1927,12 @@ fn item_fields(
.peekable();
if let None | Some(CtorKind::Fn) = ctor_kind {
if fields.peek().is_some() {
- write!(
- w,
- "
\
- {}{}§\
-
\
- {}",
+ let title = format!(
+ "{}{}",
if ctor_kind.is_none() { "Fields" } else { "Tuple Fields" },
document_non_exhaustive_header(it),
- document_non_exhaustive(it)
);
+ write_section_heading(w, &title, "fields", Some("fields"), document_non_exhaustive(it));
for (index, (field, ty)) in fields.enumerate() {
let field_name =
field.name.map_or_else(|| index.to_string(), |sym| sym.as_str().to_string());