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#90155 - jsha:outdent-methods, r=GuillaumeGo…
…mez,camelid Fix alignment of method headings for scannability We sometimes use indentation to indicate something is a heading: The section that comes after is indented by 24px relative to the heading. However, the relationship between the "Implementations" section heading, the `impl` headings it contains, and the `pub fn` subheadings within each impl, is awkward. It goes **Implementations**, 15px indent, `impl`, 5px indent, `pub fn`, 4px indent, docblock. I line up `impl` and `pub fn` with the `Implementations` heading, give `impl` a larger font size to indicate it is higher in the hierarchy, and indent the docblock a full 24px relative to their parent, matching the indents we use elsewhere to distinguish section headings. By letting the `pub fn` stick out to the left of the docblock, I think this makes methods significantly more scannable. Related to rust-lang#59829 r? `````@camelid````` [Old](https://doc.rust-lang.org/nightly/std/string/struct.String.html#implementations): [](https://doc.rust-lang.org/nightly/std/string/struct.String.html#implementations) [New](https://jacob.hoffman-andrews.com/rust/outdent-methods/std/string/struct.String.html#implementations): [](https://jacob.hoffman-andrews.com/rust/outdent-methods/std/string/struct.String.html#implementations)
- Loading branch information