Skip to content

rustdoc: don't hyperlink square brackets in method signatures #91173

Closed
@jsha

Description

@jsha

For example, in https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.get, the method signature contains a [T]:

image

In that method signature, all four instances of [ or ] are colored and hyperlinked (to https://doc.rust-lang.org/nightly/std/primitive.slice.html).

These hyperlinks aren't very useful. For one thing, they present a very tiny click target, which is bad UX. For another thing, it's quite rare to be reading Rust documentation and needs to clarify that the [ and ] indicate a slice. We should remove these and save a little bit of page size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions