Skip to content

Don't auto-hide inherent impls even if rustdoc-collapse == true. #51527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Jun 12, 2018

This PR changes the auto-collapse behavior when a page is first loaded:

  • Inherent impls will never be collapsed by default (new behavior).
  • Trait impls will always be collapsed by default, same as before.
  • Other items are collapsed according to localStorage, same as before.

This should be much more useful since there is no hint what the content of a collapsed inherent impl would be (try to collapse everything in https://doc.rust-lang.org/std/vec/struct.Vec.html and guess where a method like try_reserve or splice would be).

Manually clicking the global [-]/[+] will still collapse/expand everything.

@kennytm kennytm added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 12, 2018
@rust-highfive
Copy link
Contributor

Some changes occurred in HTML/CSS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Contributor

r? @frewsxcv

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 12, 2018
@kennytm
Copy link
Member Author

kennytm commented Jun 12, 2018

r? @GuillaumeGomez

onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
collapseDocs(e, "show");
});
if (!fromAutoCollapse) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!== true

onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
collapseDocs(e, "hide", pageId);
});
if (!fromAutoCollapse) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!== true

@GuillaumeGomez
Copy link
Member

Working fine for me so please fix my two comments and then it's good to go. Thanks!

@kennytm kennytm force-pushed the do-not-auto-hide-inherent-impl branch from 8c54081 to ca65a5e Compare June 13, 2018 10:00
@kennytm
Copy link
Member Author

kennytm commented Jun 13, 2018

@bors r=GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Jun 13, 2018

📌 Commit ca65a5e has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 13, 2018
@bors
Copy link
Collaborator

bors commented Jun 13, 2018

⌛ Testing commit ca65a5e with merge 7f20af0...

bors added a commit that referenced this pull request Jun 13, 2018
…laumeGomez

Don't auto-hide inherent impls even if `rustdoc-collapse == true`.

This PR changes the auto-collapse behavior when a page is first loaded:

* Inherent impls will never be collapsed by default (new behavior).
* Trait impls will always be collapsed by default, same as before.
* Other items are collapsed according to localStorage, same as before.

This should be much more useful since there is no hint what the content of a collapsed inherent impl would be (try to collapse everything in https://doc.rust-lang.org/std/vec/struct.Vec.html and guess where a method like `try_reserve` or `splice` would be).

Manually clicking the global [-]/[+] will still collapse/expand everything.
@kennytm
Copy link
Member Author

kennytm commented Jun 13, 2018

@bors rollup

@bors
Copy link
Collaborator

bors commented Jun 13, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing 7f20af0 to master...

@bors bors merged commit ca65a5e into rust-lang:master Jun 13, 2018
@kennytm kennytm deleted the do-not-auto-hide-inherent-impl branch June 13, 2018 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants