Rollup merge of #112243 - GuillaumeGomez:rm-unneeded-buffer-creations, r=notriddle
Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly With the recent changes, `wrap_item` can now directly take `&mut Write`, which makes some `Buffer` creations unneeded. r? `@notriddle`
This commit is contained in:
commit
aabffef06d
2 changed files with 19 additions and 24 deletions
|
@ -1040,9 +1040,9 @@ fn render_attributes_in_pre<'a, 'b: 'a>(
|
|||
|
||||
// When an attribute is rendered inside a <code> tag, it is formatted using
|
||||
// a div to produce a newline after it.
|
||||
fn render_attributes_in_code(w: &mut Buffer, it: &clean::Item, tcx: TyCtxt<'_>) {
|
||||
for a in it.attributes(tcx, false) {
|
||||
write!(w, "<div class=\"code-attribute\">{}</div>", a);
|
||||
fn render_attributes_in_code(w: &mut impl fmt::Write, it: &clean::Item, tcx: TyCtxt<'_>) {
|
||||
for attr in it.attributes(tcx, false) {
|
||||
write!(w, "<div class=\"code-attribute\">{attr}</div>").unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue