-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: Don't add extra newlines for fully opaque structs #35667
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I like it, but want to talk about it with the docs team |
I like this as well. |
I'm against until it adds back the |
Same as @ubsan. |
Concerns raised in the docs meeting:
So, we are vaguely 👍 on this idea, but have some concerns. Let's keep discussing this in-issue. |
|
I've fixed the case of empty braced structs. Now they're displayed as
|
@ollie27 could you re-render the "after" picture so we can easily look at the change? |
I've updated the PR message to hopefully clear things up. Sorry for causing so much confusion. |
I like this, but would vaguely prefer pub struct Vec<T> { /*...*/ } |
@ollie27 we talked about this at the docs team meeting, and we like this, but would prefer this:
Can you change it to that, then? We can merge after. |
Changes the definition for opaque structs to look like `pub struct Vec<T> { /* fields omitted */ }` to save space on the page. Also only use one line for empty braced structs.
d7c4171
to
8154a6b
Compare
I've changed it to |
👍 |
@bors: r+ thank you so much! |
📌 Commit 8154a6b has been approved by |
rustdoc: Don't add extra newlines for fully opaque structs Changes the definition for braced structs with only private or hidden fields to save space on the page. Before: ``` pub struct Vec<T> { // some fields omitted } ``` After: ``` pub struct Vec<T> { /* fields omitted */ } ``` This also cleans up empty braced structs. Before: ``` pub struct Foo { } ``` After: ``` pub struct Foo {} ``` [before](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html) [after](https://ollie27.github.io/rust_doc_test/std/vec/struct.Vec.html) cc #34713
Changes the definition for braced structs with only private or hidden fields to save space on the page.
Before:
After:
This also cleans up empty braced structs.
Before:
After:
before after
cc #34713