about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2023-03-09 14:23:56 -0800
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2023-03-11 15:36:50 -0800
commit121ae1d29cd22e3438732077b6fc3d3587f30ec3 (patch)
tree23d82ec82d747a4ae6fdb4c942eb70ddaa0e1acb /compiler/rustc_codegen_gcc/example
parent6dfaa143662ddfd6ed2fecadef20eae0ec5d267d (diff)
downloadrust-121ae1d29cd22e3438732077b6fc3d3587f30ec3.tar.gz
rust-121ae1d29cd22e3438732077b6fc3d3587f30ec3.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_gcc/example')
0 files changed, 0 insertions, 0 deletions