Skip to content

Commit 0ab09e0

Browse files
committed
Auto merge of #109011 - jsha:reduce-allocations-inner-full-print, r=notriddle
rustdoc: reduce allocs in FnDecl::inner_full_print Instead of maintaining parallel buffers for both HTML and non-HTML output, follow the idiom from the rest of format.rs that f.alternate() == true means textual output. Also, add an argument to control line wrapping explicitly. This allows the caller to render once with textual output and no line wrapping, to decide whether line wrapping should be applied in the final HTML output. Also, remove some format! and " ".repeat calls, and remove a dependency on calling `String::replace` to switch from newlines to spaces. This coincidentally fixes some minor bugs where the old code was undercounting the number of characters for a declaration in text mode.
2 parents aa826b2 + a05dc38 commit 0ab09e0

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)