about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorsladynnunes <snunes@usc.edu>2023-05-28 02:14:36 -0700
committersladynnunes <snunes@usc.edu>2023-06-08 00:09:15 -0700
commit29a51e14d9d7eb299683556a172cd06a11237b35 (patch)
tree8e3fd30f9df91f3dc821f3752e0f9d3b0cfe01be /src
parent2560b80a08597e4192aa3ee5a4670e36a5e4a7dd (diff)
downloadrust-29a51e14d9d7eb299683556a172cd06a11237b35.tar.gz
rust-29a51e14d9d7eb299683556a172cd06a11237b35.zip
Migrate item_opaque_type to Askama
Migrate item_opaque_type to Askama

Fix wrap_item parameters

Fix to write
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render/print_item.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 62027a3fa19..1e36ca1ae7f 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -1124,7 +1124,12 @@ fn item_trait_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &
     write!(w, "{}", render_assoc_items(cx, it, it.item_id.expect_def_id(), AssocItemRender::All))
 }
 
-fn item_opaque_ty(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean::OpaqueTy) {
+fn item_opaque_ty(
+    w: &mut impl fmt::Write,
+    cx: &mut Context<'_>,
+    it: &clean::Item,
+    t: &clean::OpaqueTy,
+) {
     wrap_item(w, |w| {
         write!(
             w,
@@ -1134,16 +1139,18 @@ fn item_opaque_ty(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &cl
             where_clause = print_where_clause(&t.generics, cx, 0, Ending::Newline),
             bounds = bounds(&t.bounds, false, cx),
             attrs = render_attributes_in_pre(it, "", cx.tcx()),
-        );
+        )
+        .unwrap();
     });
 
-    write!(w, "{}", document(cx, it, None, HeadingOffset::H2));
+    write!(w, "{}", document(cx, it, None, HeadingOffset::H2)).unwrap();
 
     // Render any items associated directly to this alias, as otherwise they
     // won't be visible anywhere in the docs. It would be nice to also show
     // associated items from the aliased type (see discussion in #32077), but
     // we need #14072 to make sense of the generics.
     write!(w, "{}", render_assoc_items(cx, it, it.item_id.expect_def_id(), AssocItemRender::All))
+        .unwrap();
 }
 
 fn item_typedef(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean::Typedef) {