Skip to content

Commit 2a0c9e2

Browse files
committed
Address nit
1 parent e3274fd commit 2a0c9e2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustdoc/clean/mod.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -2208,6 +2208,7 @@ fn clean_use_statement(
22082208

22092209
// Also check whether imports were asked to be inlined, in case we're trying to re-export a
22102210
// crate in Rust 2018+
2211+
let def_id = cx.tcx.hir().local_def_id(import.hir_id).to_def_id();
22112212
let path = path.clean(cx);
22122213
let inner = if kind == hir::UseKind::Glob {
22132214
if !denied {
@@ -2239,7 +2240,7 @@ fn clean_use_statement(
22392240
&mut visited,
22402241
) {
22412242
items.push(Item::from_def_id_and_parts(
2242-
cx.tcx.hir().local_def_id(import.hir_id).to_def_id(),
2243+
def_id,
22432244
None,
22442245
ImportItem(Import::new_simple(name, resolve_use_source(cx, path), false)),
22452246
cx,
@@ -2250,12 +2251,7 @@ fn clean_use_statement(
22502251
Import::new_simple(name, resolve_use_source(cx, path), true)
22512252
};
22522253

2253-
vec![Item::from_def_id_and_parts(
2254-
cx.tcx.hir().local_def_id(import.hir_id).to_def_id(),
2255-
None,
2256-
ImportItem(inner),
2257-
cx,
2258-
)]
2254+
vec![Item::from_def_id_and_parts(def_id, None, ImportItem(inner), cx)]
22592255
}
22602256

22612257
impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Symbol>) {

0 commit comments

Comments
 (0)