forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#90089 - jsha:enum-fields-headings, r=cameli…
…d,GuillaumeGomez Improve display of enum variants Use h3 and h4 for the variant name and the "Fields" subheading. Remove the "of T" part of the "Fields" subheading. Remove border-bottom from "Fields" subheading. Move docblock below "Fields" listing. Fixes rust-lang#90061 Demo: https://jacob.hoffman-andrews.com/rust/xmlparser-updated/xmlparser/enum.Token.html#variants https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/io/enum.ErrorKind.html#variants https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/result/enum.Result.html#variants r? `@camelid`
- Loading branch information
Showing
5 changed files
with
89 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#![crate_name = "foo"] | ||
// @has foo/enum.Token.html | ||
/// A token! | ||
/// # First | ||
/// Some following text... | ||
// @has - '//h2[@id="first"]' "First" | ||
pub enum Token { | ||
/// A declaration! | ||
/// # Variant-First | ||
/// Some following text... | ||
// @has - '//h4[@id="variant-first"]' "Variant-First" | ||
Declaration { | ||
/// A version! | ||
/// # Variant-Field-First | ||
/// Some following text... | ||
// @has - '//h5[@id="variant-field-first"]' "Variant-Field-First" | ||
version: String, | ||
}, | ||
/// A Zoople! | ||
/// # Variant-First | ||
Zoople( | ||
// @has - '//h5[@id="variant-tuple-field-first"]' "Variant-Tuple-Field-First" | ||
/// Zoople's first variant! | ||
/// # Variant-Tuple-Field-First | ||
/// Some following text... | ||
usize, | ||
), | ||
/// Unfinished business! | ||
/// # Non-Exhaustive-First | ||
/// Some following text... | ||
// @has - '//h4[@id="non-exhaustive-first"]' "Non-Exhaustive-First" | ||
#[non_exhaustive] | ||
Unfinished { | ||
/// This is x. | ||
/// # X-First | ||
/// Some following text... | ||
// @has - '//h5[@id="x-first"]' "X-First" | ||
x: usize, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters