Skip to content

Commit

Permalink
librustdoc: render: use render_into instead of creating a temp string
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
  • Loading branch information
mfrw committed Feb 1, 2022
1 parent 66d7e50 commit 62bea63
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/librustdoc/html/render/print_item.rs
Expand Up @@ -139,8 +139,7 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
src_href: src_href.as_deref(),
};

let heading = item_vars.render().unwrap();
buf.write_str(&heading);
item_vars.render_into(buf).unwrap();

match *item.kind {
clean::ModuleItem(ref m) => item_module(buf, cx, item, &m.items),
Expand Down

0 comments on commit 62bea63

Please sign in to comment.