From f879ecc4ef62b5c434e85a9db845b6c1020162ca Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 5 Mar 2021 16:04:24 +0100 Subject: Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to make transition over hir::ItemKind simpler --- src/librustdoc/html/render/print_item.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/librustdoc/html') diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 6d61248f28e..6cdd3838023 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -240,7 +240,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl } match *myitem.kind { - clean::ExternCrateItem(ref name, ref src) => { + clean::ExternCrateItem { ref src } => { use crate::html::format::anchor; match *src { @@ -249,13 +249,13 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl "{}extern crate {} as {};", myitem.visibility.print_with_space(cx.tcx(), myitem.def_id, cx.cache()), anchor(myitem.def_id, &*src.as_str(), cx.cache()), - name + myitem.name.as_ref().unwrap(), ), None => write!( w, "{}extern crate {};", myitem.visibility.print_with_space(cx.tcx(), myitem.def_id, cx.cache()), - anchor(myitem.def_id, &*name.as_str(), cx.cache()) + anchor(myitem.def_id, &*myitem.name.as_ref().unwrap().as_str(), cx.cache()), ), } w.write_str(""); -- cgit 1.4.1-3-g733a5