Repository navigation
Documentation addition request #92276
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
The standard way to implement debug is to use the debug builders
fmt.debug_struct(..), which is documented there.I think this is a very reasonable ask. It doesn't make much sense to use the debug builders for very simple implementations of
Debug, and for those just starting out, and the importance of using the builders for more complicated Debug impls is minimal.@alper you'd be welcome to submit a PR with a proposed example! You just need to edit the rustdoc comment for
Debug:rust/library/core/src/fmt/mod.rs
Line 505 in 51e8031
/// `?` formatting. @rustbot label +T-libs A-docs +E-easy
- addedA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-docs-rsRelevant to the docs-rs subteam, which will review and decide on the PR/issue.Relevant to the docs-rs subteam, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.and removedT-docs-rsRelevant to the docs-rs subteam, which will review and decide on the PR/issue.Relevant to the docs-rs subteam, which will review and decide on the PR/issue.
on Dec 26, 2021 Thanks, @BGR360! My PR is linked above.
Thanks for the prodding. My change has now been merged. 🎉
Reacted by Ben Reeves
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
I'm trying to implement Debug occasionally, then I hit this page:
https://doc.rust-lang.org/stable/core/fmt/trait.Debug.html
The examples on that page do not contain something that uses
write!so I usually google my way to the same SO answer: https://stackoverflow.com/a/22243806/102315Could the documentation there be expanded to add this?