You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #137274 - yotamofek:pr/rustdoc/lazy-escape, r=<try>
Allow lazy HTML escaping
Inspired by [this comment](#136828 (comment)) by `@aDotInTheVoid` .
Makes `Escape` and `EscapeBodyText` accept any `impl fmt::Display`, instead of a `&str`, which allows us to avoid a few interim `String` allocations.
This opens up room for more lazifying, but I'll keep those for a separate PR.
Unfortunately, I think there might be a hit to performance because of the double vtable-indirection caused by wrapping a `fmt::Formatter` in another one, but I think that I should be able to gain that perf back by doing more lazy printing (either the small things improvements I made in this PR, or in later ones)
Probably better to review each commit individually.
0 commit comments