Remove unneeded Buffer
allocations when &mut fmt::Write
can be used directly
This commit is contained in:
parent
1e17cef9e2
commit
5c77a0d7a7
2 changed files with 18 additions and 23 deletions
|
@ -1038,9 +1038,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<'_>) {
|
||||
fn render_attributes_in_code(w: &mut impl fmt::Write, it: &clean::Item, tcx: TyCtxt<'_>) {
|
||||
for a in it.attributes(tcx, false) {
|
||||
write!(w, "<div class=\"code-attribute\">{}</div>", a);
|
||||
write!(w, "<div class=\"code-attribute\">{}</div>", a).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue