about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-03 14:37:23 +0000
committerbors <bors@rust-lang.org>2023-06-03 14:37:23 +0000
commit2f5e6bb817c115c067ff47453eb9aa89a0a31358 (patch)
tree8da3ac05cd4c7b50ece8f0225447b1401c334527 /src/librustdoc/html/render
parent1e17cef9e29961636db63730784caea4b7d47ff5 (diff)
parentc5e5d6958c62c8dd3623cacc03b43453e54e2724 (diff)
downloadrust-2f5e6bb817c115c067ff47453eb9aa89a0a31358.tar.gz
rust-2f5e6bb817c115c067ff47453eb9aa89a0a31358.zip
Auto merge of #112032 - sladyn98:migrate-item-primitive, r=GuillaumeGomez
Migrate  `item_primitive` to Askama

This PR migrates `item_primitive` to Askama

Refers https://github.com/rust-lang/rust/issues/108868
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/print_item.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 1d66805bd5c..156c8c06e76 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -1457,11 +1457,11 @@ fn item_proc_macro(
     write!(w, "{}{}", buffer.into_inner(), document(cx, it, None, HeadingOffset::H2)).unwrap();
 }
 
-fn item_primitive(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) {
+fn item_primitive(w: &mut impl fmt::Write, cx: &mut Context<'_>, it: &clean::Item) {
     let def_id = it.item_id.expect_def_id();
-    write!(w, "{}", document(cx, it, None, HeadingOffset::H2));
+    write!(w, "{}", document(cx, it, None, HeadingOffset::H2)).unwrap();
     if it.name.map(|n| n.as_str() != "reference").unwrap_or(false) {
-        write!(w, "{}", render_assoc_items(cx, it, def_id, AssocItemRender::All));
+        write!(w, "{}", render_assoc_items(cx, it, def_id, AssocItemRender::All)).unwrap();
     } else {
         // We handle the "reference" primitive type on its own because we only want to list
         // implementations on generic types.