From 6f6afae41aee721fd259a8a764ec96f93bc07911 Mon Sep 17 00:00:00 2001 From: Camelid Date: Wed, 30 Dec 2020 16:41:18 -0800 Subject: [PATCH] Small refactor --- src/librustdoc/clean/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 666d418cc0e..ae329dc62f1 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2295,20 +2295,19 @@ fn clean(&self, cx: &DocContext<'_>) -> Item { ) } 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()); + let def_id = cx.tcx.hir().local_def_id(item.hir_id).to_def_id(); if matchers.len() <= 1 { format!( "{}macro {}{} {{\n ...\n}}", - vis_printed_with_space, + vis.print_with_space(cx.tcx, def_id), name, matchers.iter().map(|span| span.to_src(cx)).collect::(), ) } else { format!( "{}macro {} {{\n{}}}", - vis_printed_with_space, + vis.print_with_space(cx.tcx, def_id), name, matchers .iter()