diff options
| author | Michael Howell <michael@notriddle.com> | 2024-03-30 12:57:10 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2024-04-09 11:39:26 -0700 |
| commit | 5f84f4bdc92caca64ed58509abe3c313f3c3454a (patch) | |
| tree | 8605b33cc51d6fb388d6c10dcab006b099b07228 | |
| parent | 033becf83c62814357f4810db149471db46ab816 (diff) | |
| download | rust-5f84f4bdc92caca64ed58509abe3c313f3c3454a.tar.gz rust-5f84f4bdc92caca64ed58509abe3c313f3c3454a.zip | |
rustdoc: clean up type alias code
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index fbb521a6188..befb27f9320 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -1237,22 +1237,18 @@ fn item_opaque_ty( } fn item_type_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean::TypeAlias) { - fn write_content(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::TypeAlias) { - wrap_item(w, |w| { - write!( - w, - "{attrs}{vis}type {name}{generics}{where_clause} = {type_};", - attrs = render_attributes_in_pre(it, "", cx), - vis = visibility_print_with_space(it, cx), - name = it.name.unwrap(), - generics = t.generics.print(cx), - where_clause = print_where_clause(&t.generics, cx, 0, Ending::Newline), - type_ = t.type_.print(cx), - ); - }); - } - - write_content(w, cx, it, t); + wrap_item(w, |w| { + write!( + w, + "{attrs}{vis}type {name}{generics}{where_clause} = {type_};", + attrs = render_attributes_in_pre(it, "", cx), + vis = visibility_print_with_space(it, cx), + name = it.name.unwrap(), + generics = t.generics.print(cx), + where_clause = print_where_clause(&t.generics, cx, 0, Ending::Newline), + type_ = t.type_.print(cx), + ); + }); write!(w, "{}", document(cx, it, None, HeadingOffset::H2)); |
