Skip to content

Commit 69e1722

Browse files
camelidMark-Simulacrum
authored andcommitted
Extract local variable
1 parent 0c127b3 commit 69e1722

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,24 +2311,20 @@ impl Clean<Item> for (&hir::MacroDef<'_>, Option<Symbol>) {
23112311
)
23122312
} else {
23132313
let vis = item.vis.clean(cx);
2314+
let vis_printed_with_space =
2315+
vis.print_with_space(cx.tcx, cx.tcx.hir().local_def_id(item.hir_id).to_def_id());
23142316

23152317
if matchers.len() <= 1 {
23162318
format!(
23172319
"{}macro {}{} {{\n ...\n}}",
2318-
vis.print_with_space(
2319-
cx.tcx,
2320-
cx.tcx.hir().local_def_id(item.hir_id).to_def_id()
2321-
),
2320+
vis_printed_with_space,
23222321
name,
23232322
matchers.iter().map(|span| span.to_src(cx)).collect::<String>(),
23242323
)
23252324
} else {
23262325
format!(
23272326
"{}macro {} {{\n{}}}",
2328-
vis.print_with_space(
2329-
cx.tcx,
2330-
cx.tcx.hir().local_def_id(item.hir_id).to_def_id()
2331-
),
2327+
vis_printed_with_space,
23322328
name,
23332329
matchers
23342330
.iter()

0 commit comments

Comments
 (0)