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

Commit 478cbb0

Browse files
committed
Extract local variable
1 parent eaf8512 commit 478cbb0

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
@@ -2295,24 +2295,20 @@ impl Clean<Item> for (&hir::MacroDef<'_>, Option<Symbol>) {
22952295
)
22962296
} else {
22972297
let vis = item.vis.clean(cx);
2298+
let vis_printed_with_space =
2299+
vis.print_with_space(cx.tcx, cx.tcx.hir().local_def_id(item.hir_id).to_def_id());
22982300

22992301
if matchers.len() <= 1 {
23002302
format!(
23012303
"{}macro {}{} {{\n ...\n}}",
2302-
vis.print_with_space(
2303-
cx.tcx,
2304-
cx.tcx.hir().local_def_id(item.hir_id).to_def_id()
2305-
),
2304+
vis_printed_with_space,
23062305
name,
23072306
matchers.iter().map(|span| span.to_src(cx)).collect::<String>(),
23082307
)
23092308
} else {
23102309
format!(
23112310
"{}macro {} {{\n{}}}",
2312-
vis.print_with_space(
2313-
cx.tcx,
2314-
cx.tcx.hir().local_def_id(item.hir_id).to_def_id()
2315-
),
2311+
vis_printed_with_space,
23162312
name,
23172313
matchers
23182314
.iter()

0 commit comments

Comments
 (0)