Skip to content

Commit afec6d2

Browse files
Remove unneeded Option<Symbol> in foreign_items
1 parent c845a53 commit afec6d2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
9090
}
9191
v
9292
}));
93-
items.extend(doc.inlined_foreigns.values().flat_map(|(res, renamed, local_import_id)| {
93+
items.extend(doc.inlined_foreigns.iter().flat_map(|((_, renamed), (res, local_import_id))| {
9494
let Some(def_id) = res.opt_def_id() else { return Vec::new() };
9595
let name = renamed.unwrap_or_else(|| cx.tcx.item_name(def_id));
9696
let import = cx.tcx.hir().expect_item(*local_import_id);

src/librustdoc/visit_ast.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ pub(crate) struct Module<'hir> {
3636
(&'hir hir::Item<'hir>, Option<Symbol>, Option<LocalDefId>),
3737
>,
3838
/// Same as for `items`.
39-
pub(crate) inlined_foreigns:
40-
FxIndexMap<(DefId, Option<Symbol>), (Res, Option<Symbol>, LocalDefId)>,
39+
pub(crate) inlined_foreigns: FxIndexMap<(DefId, Option<Symbol>), (Res, LocalDefId)>,
4140
pub(crate) foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>,
4241
}
4342

@@ -295,7 +294,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
295294
.last_mut()
296295
.unwrap()
297296
.inlined_foreigns
298-
.insert((ori_res_did, renamed), (res, renamed, def_id));
297+
.insert((ori_res_did, renamed), (res, def_id));
299298
return true;
300299
};
301300

0 commit comments

Comments
 (0)