diff options
Diffstat (limited to 'src/librustdoc/html/render/write_shared.rs')
| -rw-r--r-- | src/librustdoc/html/render/write_shared.rs | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index 57d07c05c11..a4dec013fc0 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -44,7 +44,6 @@ use crate::docfs::PathError; use crate::error::Error; use crate::formats::Impl; use crate::formats::item_type::ItemType; -use crate::html::format::Buffer; use crate::html::layout; use crate::html::render::ordered_json::{EscapedJson, OrderedJson}; use crate::html::render::search_index::{SerializedSearchIndex, build_index}; @@ -622,7 +621,6 @@ impl TypeAliasPart { // to make that functionality work here, it needs to be called with // each type alias, and if it gives a different result, split the impl for &(type_alias_fqp, type_alias_item) in type_aliases { - let mut buf = Buffer::html(); cx.id_map.borrow_mut().clear(); cx.deref_id_map.borrow_mut().clear(); let target_did = impl_ @@ -638,23 +636,26 @@ impl TypeAliasPart { } else { AssocItemLink::Anchor(None) }; - super::render_impl( - &mut buf, - cx, - impl_, - type_alias_item, - assoc_link, - RenderMode::Normal, - None, - &[], - ImplRenderingParameters { - show_def_docs: true, - show_default_items: true, - show_non_assoc_items: true, - toggle_open_by_default: true, - }, - ); - let text = buf.into_inner(); + let text = { + let mut buf = String::new(); + super::render_impl( + &mut buf, + cx, + impl_, + type_alias_item, + assoc_link, + RenderMode::Normal, + None, + &[], + ImplRenderingParameters { + show_def_docs: true, + show_default_items: true, + show_non_assoc_items: true, + toggle_open_by_default: true, + }, + ); + buf + }; let type_alias_fqp = (*type_alias_fqp).iter().join("::"); if Some(&text) == ret.last().map(|s: &AliasSerializableImpl| &s.text) { ret.last_mut() |
