Skip to content

Commit 0584ddc

Browse files
committed
Address nit
1 parent 7a0f0b5 commit 0584ddc

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,7 @@ fn clean_use_statement(
22212221

22222222
// Also check whether imports were asked to be inlined, in case we're trying to re-export a
22232223
// crate in Rust 2018+
2224+
let def_id = cx.tcx.hir().local_def_id(import.hir_id).to_def_id();
22242225
let path = path.clean(cx);
22252226
let inner = if kind == hir::UseKind::Glob {
22262227
if !denied {
@@ -2252,7 +2253,7 @@ fn clean_use_statement(
22522253
&mut visited,
22532254
) {
22542255
items.push(Item::from_def_id_and_parts(
2255-
cx.tcx.hir().local_def_id(import.hir_id).to_def_id(),
2256+
def_id,
22562257
None,
22572258
ImportItem(Import::new_simple(name, resolve_use_source(cx, path), false)),
22582259
cx,
@@ -2263,12 +2264,7 @@ fn clean_use_statement(
22632264
Import::new_simple(name, resolve_use_source(cx, path), true)
22642265
};
22652266

2266-
vec![Item::from_def_id_and_parts(
2267-
cx.tcx.hir().local_def_id(import.hir_id).to_def_id(),
2268-
None,
2269-
ImportItem(inner),
2270-
cx,
2271-
)]
2267+
vec![Item::from_def_id_and_parts(def_id, None, ImportItem(inner), cx)]
22722268
}
22732269

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

0 commit comments

Comments
 (0)