-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rustdoc: unify impl blocks where possible. #52563
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
Comments
I'd like to help implement this, but I've not hacked on rustdoc before. |
Sometimes this might be done deliberately, e.g. breaking impls into sets of 2-4 methods to keep |
Hmm, I'm not sure how to reconcile the two things. I didn't know you could write docs on impl blocks. I'm not proposing unifying impl blocks with different impl<T> Vec<T> {
// ...
}
impl<T> Vec<T>
where T: Clone
{
// ...
} whereas these would be unified impl<T> Vec<T> {
// ...
}
impl<T> Vec<T> {
// ...
} EDIT I guess I'm arguing that which |
Triage: don't believe there's any change here |
It would be great to be able to do this even if behind a flag or similar - the web-sys docs would benefit greatly from this. |
A solution to this is to unify those impl blocks with the same docstrings and |
I think that unifying on the same doc string is a great idea!
…On Sun, 19 Sep 2021, 11:45 Tomek Czajka, ***@***.***> wrote:
Sometimes this might be done deliberately, e.g. breaking impls into sets
of 2-4 methods to keep where clauses closer to methods, or to write
docstrings on the impl blocks.
A solution to this is to unify those impl blocks with the same docstrings
and where clauses.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#52563 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKT4XSVWFBF3ZVZ4YP2WQTUCW5MRANCNFSM4FK7H5XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Related: #82408 |
From #32631:
I have run into a similar problem when using codegen (specifically, in web-sys), where currently each function/value is inside its own impl block, e.g.
Presently all these appear as separate impl blocks in rustdoc. It would be easier to read if they were in a single block.
The text was updated successfully, but these errors were encountered: