-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Refactor: Extract render_summary from render_impl. #86128
Conversation
This allows for a more readable straight-through logic in render_impl without need for a closure.
Thanks! @bors: r+ |
📌 Commit 1c0ecd4 has been approved by |
write!( | ||
w, | ||
"<div id=\"{}\" class=\"impl has-srclink\"{}>\ | ||
<code class=\"in-band\">{}</code>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raw strings could make this more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, thanks! I think we use non-raw strings in rustdoc to minimize whitespace (by putting \
at the end of the line). Also, I hope to introduce the use of a templating engine soonish, which would make things even more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that we don't use raw strings to generate smaller content.
Rollup of 11 pull requests Successful merges: - rust-lang#85676 (Fix documentation style inconsistencies for IP addresses) - rust-lang#85715 (Document `From` impls in string.rs) - rust-lang#85791 (Add `Ipv6Addr::is_unicast`) - rust-lang#85957 (Display defaults on const params- rustdoc ) - rust-lang#85982 (Enable rustdoc to document safe wasm intrinsics) - rust-lang#86121 (Forwarding implementation for Seek trait's stream_position method) - rust-lang#86124 (Include macro name in 'local ambiguity' error) - rust-lang#86128 (Refactor: Extract render_summary from render_impl.) - rust-lang#86142 (Simplify proc_macro code using Bound::cloned().) - rust-lang#86158 (Update books) - rust-lang#86159 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This allows for a more readable straight-through logic in render_impl without need for a closure.
I think this will make #85970 a bit more of a straightforward change.
This is a pure refactoring. I've verified that the output of
x.py doc library/std
is byte-for-byte identical.r? @GuillaumeGomez