about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-10-24 15:48:44 +0200
committerGitHub <noreply@github.com>2021-10-24 15:48:44 +0200
commitb8376050127b3d1806ae88e6916ddaf330ca699c (patch)
tree6e5df3165789746da3734374732e5f7ed2767fac /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentd814af95baec4f1819b03ec878c83b8171031c54 (diff)
parent542ab2daa6eb4b05a01403114783aa323315b416 (diff)
downloadrust-b8376050127b3d1806ae88e6916ddaf330ca699c.tar.gz
rust-b8376050127b3d1806ae88e6916ddaf330ca699c.zip
Rollup merge of #90155 - jsha:outdent-methods, r=GuillaumeGomez,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 #59829

r? `````@camelid`````

[Old](https://doc.rust-lang.org/nightly/std/string/struct.String.html#implementations):

[![image](https://user-images.githubusercontent.com/220205/138380233-9c63a0f2-0f80-40a3-ab3d-a1ee9fb7c5d8.png)](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):

[![image](https://user-images.githubusercontent.com/220205/138392479-b45fce3f-bf43-42e0-81ee-c4bb9ac35cda.png)](https://jacob.hoffman-andrews.com/rust/outdent-methods/std/string/struct.String.html#implementations)
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions