Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7a8d26e

Browse files
committed
make item_keyword return impl fmt::Display
1 parent d7619f4 commit 7a8d26e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut String)
265265
format_args!("{}", item_constant(cx, item, &ci.generics, &ci.type_, &ci.kind)),
266266
),
267267
clean::ForeignTypeItem => write_str(buf, format_args!("{}", item_foreign_type(cx, item))),
268-
clean::KeywordItem => item_keyword(buf, cx, item),
268+
clean::KeywordItem => write_str(buf, format_args!("{}", item_keyword(cx, item))),
269269
clean::TraitAliasItem(ref ta) => item_trait_alias(buf, cx, item, ta),
270270
_ => {
271271
// We don't generate pages for any other type.
@@ -2142,8 +2142,11 @@ fn item_foreign_type<'a, 'tcx>(
21422142
})
21432143
}
21442144

2145-
fn item_keyword(w: &mut String, cx: &Context<'_>, it: &clean::Item) {
2146-
write_str(w, format_args!("{}", document(cx, it, None, HeadingOffset::H2)));
2145+
fn item_keyword<'a, 'tcx>(
2146+
cx: &'a Context<'tcx>,
2147+
it: &'a clean::Item,
2148+
) -> impl fmt::Display + 'a + Captures<'tcx> {
2149+
document(cx, it, None, HeadingOffset::H2)
21472150
}
21482151

21492152
/// Compare two strings treating multi-digit numbers as single units (i.e. natural sort order).

0 commit comments

Comments
 (0)