Skip to content

Commit fd5d614

Browse files
committed
Move def_id logic into render_call_locations
1 parent d1c29c6 commit fd5d614

File tree

1 file changed

+3
-4
lines changed
  • src/librustdoc/html/render

1 file changed

+3
-4
lines changed

src/librustdoc/html/render/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,7 @@ fn document_full_inner(
598598
};
599599

600600
if let clean::ItemKind::FunctionItem(..) | clean::ItemKind::MethodItem(..) = kind {
601-
if let Some(def_id) = item.def_id.as_def_id() {
602-
render_call_locations(w, cx, def_id, item);
603-
}
601+
render_call_locations(w, cx, item);
604602
}
605603
}
606604

@@ -2463,8 +2461,9 @@ const MAX_FULL_EXAMPLES: usize = 5;
24632461
const NUM_VISIBLE_LINES: usize = 10;
24642462

24652463
/// Generates the HTML for example call locations generated via the --scrape-examples flag.
2466-
fn render_call_locations(w: &mut Buffer, cx: &Context<'_>, def_id: DefId, item: &clean::Item) {
2464+
fn render_call_locations(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item) {
24672465
let tcx = cx.tcx();
2466+
let def_id = item.def_id.expect_def_id();
24682467
let key = tcx.def_path_hash(def_id);
24692468
let call_locations = match cx.shared.call_locations.get(&key) {
24702469
Some(call_locations) => call_locations,

0 commit comments

Comments
 (0)