Skip to content

rustdoc: sidebar generation code duplicates logic #138576

@lolbinarycat

Description

@lolbinarycat

I recently discovered this in #138574, when I fixed the bug for the main page, but the erroneous items were still in the sidebar.

If we simply collected a list of sidebar items during rendering of the main page, almost the entirety of sidebar.rs could be removed. This could even be done incrementally, with each sidebar_* function being replaced with a field on Context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.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