1
Fork 0

rustdoc: Rename expect_real to expect_def_id, remove Item::is_fake

This commit is contained in:
Justus K 2021-06-26 17:10:52 +02:00
parent 43e1cdbaf9
commit acd4dc2d0c
No known key found for this signature in database
GPG key ID: 8C62FE98A62FC462
13 changed files with 103 additions and 105 deletions

View file

@ -735,7 +735,7 @@ fn naive_assoc_href(it: &clean::Item, link: AssocItemLink<'_>, cx: &Context<'_>)
AssocItemLink::Anchor(Some(ref id)) => format!("#{}", id),
AssocItemLink::Anchor(None) => anchor,
AssocItemLink::GotoSource(did, _) => {
href(did.expect_real(), cx).map(|p| format!("{}{}", p.0, anchor)).unwrap_or(anchor)
href(did.expect_def_id(), cx).map(|p| format!("{}{}", p.0, anchor)).unwrap_or(anchor)
}
}
}
@ -867,7 +867,7 @@ fn render_assoc_item(
ItemType::TyMethod
};
href(did.expect_real(), cx)
href(did.expect_def_id(), cx)
.map(|p| format!("{}#{}.{}", p.0, ty, name))
.unwrap_or_else(|| format!("#{}.{}", ty, name))
}
@ -1819,7 +1819,7 @@ fn small_url_encode(s: String) -> String {
}
fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
let did = it.def_id.expect_real();
let did = it.def_id.expect_def_id();
if let Some(v) = cx.cache.impls.get(&did) {
let mut used_links = FxHashSet::default();
let cache = cx.cache();
@ -2109,7 +2109,7 @@ fn sidebar_trait(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, t: &clean
"</div>",
);
if let Some(implementors) = cx.cache.implementors.get(&it.def_id.expect_real()) {
if let Some(implementors) = cx.cache.implementors.get(&it.def_id.expect_def_id()) {
let cache = cx.cache();
let mut res = implementors
.iter()