\
Version {}
\
@@ -1399,7 +1399,7 @@ impl Context {
&self.shared.themes)
} else {
let mut url = self.root_path();
- if let Some(&(ref names, ty)) = cache().paths.get(&it.def_id) {
+ if let Some(&(ref names, ty)) = self.cache.paths.get(&it.def_id) {
for name in &names[..names.len() - 1] {
url.push_str(name);
url.push_str("/");
@@ -1549,7 +1549,6 @@ impl Context {
fn src_href(&self, item: &clean::Item) -> Option
{
let mut root = self.root_path();
- let cache = cache();
let mut path = String::new();
// We can safely ignore macros from other libraries
@@ -1565,7 +1564,7 @@ impl Context {
return None;
}
} else {
- let (krate, src_root) = match *cache.extern_locations.get(&item.def_id.krate)? {
+ let (krate, src_root) = match *self.cache.extern_locations.get(&item.def_id.krate)? {
(ref name, ref src, Local) => (name, src),
(ref name, ref src, Remote(ref s)) => {
root = s.to_string();
@@ -2475,11 +2474,9 @@ fn item_trait(
// If there are methods directly on this trait object, render them here.
render_assoc_items(w, cx, it, it.def_id, AssocItemRender::All);
- let cache = cache();
-
let mut synthetic_types = Vec::new();
- if let Some(implementors) = cache.implementors.get(&it.def_id) {
+ if let Some(implementors) = cx.cache.implementors.get(&it.def_id) {
// The DefId is for the first Type found with that name. The bool is
// if any Types with the same name but different DefId have been found.
let mut implementor_dups: FxHashMap<&str, (DefId, bool)> = FxHashMap::default();
@@ -2502,7 +2499,7 @@ fn item_trait(
let (local, foreign) = implementors.iter()
.partition::, _>(|i| i.inner_impl().for_.def_id()
- .map_or(true, |d| cache.paths.contains_key(&d)));
+ .map_or(true, |d| cx.cache.paths.contains_key(&d)));
let (mut synthetic, mut concrete): (Vec<&&Impl>, Vec<&&Impl>) = local.iter()
@@ -2567,7 +2564,7 @@ fn item_trait(
path = if it.def_id.is_local() {
cx.current.join("/")
} else {
- let (ref path, _) = cache.external_paths[&it.def_id];
+ let (ref path, _) = cx.cache.external_paths[&it.def_id];
path[..path.len() - 1].join("/")
},
ty = it.type_(),
@@ -3144,7 +3141,7 @@ fn render_assoc_items(w: &mut Buffer,
containing_item: &clean::Item,
it: DefId,
what: AssocItemRender<'_>) {
- let c = cache();
+ let c = &cx.cache;
let v = match c.impls.get(&it) {
Some(v) => v,
None => return,
@@ -3250,7 +3247,7 @@ fn render_deref_methods(w: &mut Buffer, cx: &Context, impl_: &Impl,
render_assoc_items(w, cx, container_item, did, what)
} else {
if let Some(prim) = target.primitive_type() {
- if let Some(&did) = cache().primitive_locations.get(&prim) {
+ if let Some(&did) = cx.cache.primitive_locations.get(&prim) {
render_assoc_items(w, cx, container_item, did, what);
}
}
@@ -3500,7 +3497,7 @@ fn render_impl(w: &mut Buffer, cx: &Context, i: &Impl, link: AssocItemLink<'_>,
}
}
- let traits = &cache().traits;
+ let traits = &cx.cache.traits;
let trait_ = i.trait_did().map(|did| &traits[&did]);
write!(w, "");
@@ -3642,7 +3639,7 @@ fn print_sidebar(cx: &Context, it: &clean::Item, buffer: &mut Buffer) {
}
if it.is_crate() {
- if let Some(ref version) = cache().crate_version {
+ if let Some(ref version) = cx.cache.crate_version {
write!(buffer,
"