-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: Remove item types from some title pages #35003
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
On most pages like structs the title does not need to include the word "Struct" because you can tell that from the definition.
(rust_highfive has picked a reviewer for you, use r? to override) |
I actually like to know directly what the type is. So I'm against this change, sorry. |
/cc @rust-lang/tools what do you think of this? |
I feel pretty neutral. I kind of like having some description in the title - makes it a little easier to read, for me. And I usually skip reading the code snippet entirely (I wish they were hidden by default in fact). OTOH, it does make the title less cluttered. |
It's a tough call. Recall that the original intent is to fix inconsistencies. Today some pages have item types in their titles some don't. So this is creating more consistency (by removing them everywhere they are redundant with the subsequent type definition). That said, I somewhat agree with @nrc that (in many cases at least) printing the complete type definition is just noise. Particularly on traits, where all the methods are immediately restated by the docs (this is really horrible) and on macros, where the definition just looks like gibberish and doesn't explain much. So maybe it would be better to go in the direction of the original PR and add item types to all pages, and remove the type definitions. Not sure. @GuillaumeGomez If your concern is knowing what the item type is, that is covered by this PR - it only removes that information where it is redundant. |
@brson: That's not what it seemed to look like but if everyone wants this merge, then let's get it. |
Well I don't really know what to do here. I personally still prefer #34345 as it's easier to read the type in the title and at least it keeps with the status quo. We can't really remove the definitions as they often contain information not available elsewhere on the page like generics. |
…bnik rustdoc: Add missing item types to page titles Most pages include the item type in the title such as "Struct std::vec::Vec". However it is missing from the pages for foreign functions, type definitions, macros, statics and constants. This adds them so for example, instead of a title of "std::u32::MAX" it is "Constant std::u32::MAX" to match the others. [before](https://doc.rust-lang.org/nightly/std/u32/constant.MAX.html) [after](https://ollie27.github.io/rust_doc_test/std/u32/constant.MAX.html) [before](https://doc.rust-lang.org/nightly/std/io/type.Result.html) [after](https://ollie27.github.io/rust_doc_test/std/io/type.Result.html) Previous discussions: rust-lang#34345, rust-lang#35003
…bnik rustdoc: Add missing item types to page titles Most pages include the item type in the title such as "Struct std::vec::Vec". However it is missing from the pages for foreign functions, type definitions, macros, statics and constants. This adds them so for example, instead of a title of "std::u32::MAX" it is "Constant std::u32::MAX" to match the others. [before](https://doc.rust-lang.org/nightly/std/u32/constant.MAX.html) [after](https://ollie27.github.io/rust_doc_test/std/u32/constant.MAX.html) [before](https://doc.rust-lang.org/nightly/std/io/type.Result.html) [after](https://ollie27.github.io/rust_doc_test/std/io/type.Result.html) Previous discussions: rust-lang#34345, rust-lang#35003
On most pages like structs the title does not need to include
the word "Struct" because you can tell that from the definition.
Previous discussion: #34345