Extract local variable
This commit is contained in:
parent
eaf851288e
commit
478cbb0095
1 changed files with 4 additions and 8 deletions
|
|
@ -2295,24 +2295,20 @@ impl Clean<Item> for (&hir::MacroDef<'_>, Option<Symbol>) {
|
|||
)
|
||||
} else {
|
||||
let vis = item.vis.clean(cx);
|
||||
let vis_printed_with_space =
|
||||
vis.print_with_space(cx.tcx, cx.tcx.hir().local_def_id(item.hir_id).to_def_id());
|
||||
|
||||
if matchers.len() <= 1 {
|
||||
format!(
|
||||
"{}macro {}{} {{\n ...\n}}",
|
||||
vis.print_with_space(
|
||||
cx.tcx,
|
||||
cx.tcx.hir().local_def_id(item.hir_id).to_def_id()
|
||||
),
|
||||
vis_printed_with_space,
|
||||
name,
|
||||
matchers.iter().map(|span| span.to_src(cx)).collect::<String>(),
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"{}macro {} {{\n{}}}",
|
||||
vis.print_with_space(
|
||||
cx.tcx,
|
||||
cx.tcx.hir().local_def_id(item.hir_id).to_def_id()
|
||||
),
|
||||
vis_printed_with_space,
|
||||
name,
|
||||
matchers
|
||||
.iter()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue