@@ -1012,11 +1012,11 @@ fn render_assoc_items(
1012
1012
what : AssocItemRender < ' _ > ,
1013
1013
) {
1014
1014
info ! ( "Documenting associated items of {:?}" , containing_item. name) ;
1015
- let v = match cx. cache . impls . get ( & it) {
1015
+ let cache = cx. cache ( ) ;
1016
+ let v = match cache. impls . get ( & it) {
1016
1017
Some ( v) => v,
1017
1018
None => return ,
1018
1019
} ;
1019
- let cache = cx. cache ( ) ;
1020
1020
let ( non_trait, traits) : ( Vec < _ > , _ ) = v. iter ( ) . partition ( |i| i. inner_impl ( ) . trait_ . is_none ( ) ) ;
1021
1021
if !non_trait. is_empty ( ) {
1022
1022
let render_mode = match what {
@@ -1063,11 +1063,11 @@ fn render_assoc_items(
1063
1063
if !traits. is_empty ( ) {
1064
1064
let deref_impl = traits
1065
1065
. iter ( )
1066
- . find ( |t| t. inner_impl ( ) . trait_ . def_id_full ( cache) == cx . cache . deref_trait_did ) ;
1066
+ . find ( |t| t. inner_impl ( ) . trait_ . def_id_full ( cache) == cache. deref_trait_did ) ;
1067
1067
if let Some ( impl_) = deref_impl {
1068
1068
let has_deref_mut = traits
1069
1069
. iter ( )
1070
- . any ( |t| t. inner_impl ( ) . trait_ . def_id_full ( cache) == cx . cache . deref_mut_trait_did ) ;
1070
+ . any ( |t| t. inner_impl ( ) . trait_ . def_id_full ( cache) == cache. deref_mut_trait_did ) ;
1071
1071
render_deref_methods ( w, cx, impl_, containing_item, has_deref_mut) ;
1072
1072
}
1073
1073
let ( synthetic, concrete) : ( Vec < & & Impl > , Vec < & & Impl > ) =
@@ -1122,6 +1122,7 @@ fn render_deref_methods(
1122
1122
container_item : & clean:: Item ,
1123
1123
deref_mut : bool ,
1124
1124
) {
1125
+ let cache = cx. cache ( ) ;
1125
1126
let deref_type = impl_. inner_impl ( ) . trait_ . as_ref ( ) . unwrap ( ) ;
1126
1127
let ( target, real_target) = impl_
1127
1128
. inner_impl ( )
@@ -1138,8 +1139,8 @@ fn render_deref_methods(
1138
1139
debug ! ( "Render deref methods for {:#?}, target {:#?}" , impl_. inner_impl( ) . for_, target) ;
1139
1140
let what =
1140
1141
AssocItemRender :: DerefFor { trait_ : deref_type, type_ : real_target, deref_mut_ : deref_mut } ;
1141
- if let Some ( did) = target. def_id_full ( cx . cache ( ) ) {
1142
- if let Some ( type_did) = impl_. inner_impl ( ) . for_ . def_id_full ( cx . cache ( ) ) {
1142
+ if let Some ( did) = target. def_id_full ( cache) {
1143
+ if let Some ( type_did) = impl_. inner_impl ( ) . for_ . def_id_full ( cache) {
1143
1144
// `impl Deref<Target = S> for S`
1144
1145
if did == type_did {
1145
1146
// Avoid infinite cycles
@@ -1149,7 +1150,7 @@ fn render_deref_methods(
1149
1150
render_assoc_items ( w, cx, container_item, did, what) ;
1150
1151
} else {
1151
1152
if let Some ( prim) = target. primitive_type ( ) {
1152
- if let Some ( & did) = cx . cache . primitive_locations . get ( & prim) {
1153
+ if let Some ( & did) = cache. primitive_locations . get ( & prim) {
1153
1154
render_assoc_items ( w, cx, container_item, did, what) ;
1154
1155
}
1155
1156
}
@@ -1286,7 +1287,7 @@ fn render_impl(
1286
1287
let render_method_item = match render_mode {
1287
1288
RenderMode :: Normal => true ,
1288
1289
RenderMode :: ForDeref { mut_ : deref_mut_ } => {
1289
- should_render_item ( & item, deref_mut_, & cx. cache )
1290
+ should_render_item ( & item, deref_mut_, cx. cache ( ) )
1290
1291
}
1291
1292
} ;
1292
1293
@@ -1678,7 +1679,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
1678
1679
}
1679
1680
1680
1681
if it. is_crate ( ) {
1681
- if let Some ( ref version) = cx. cache . crate_version {
1682
+ if let Some ( ref version) = cx. cache ( ) . crate_version {
1682
1683
write ! (
1683
1684
buffer,
1684
1685
"<div class=\" block version\" >\
@@ -1825,18 +1826,16 @@ fn small_url_encode(s: String) -> String {
1825
1826
1826
1827
fn sidebar_assoc_items ( cx : & Context < ' _ > , out : & mut Buffer , it : & clean:: Item ) {
1827
1828
let did = it. def_id . expect_def_id ( ) ;
1828
- if let Some ( v) = cx. cache . impls . get ( & did) {
1829
+ let cache = cx. cache ( ) ;
1830
+ if let Some ( v) = cache. impls . get ( & did) {
1829
1831
let mut used_links = FxHashSet :: default ( ) ;
1830
- let cache = cx. cache ( ) ;
1831
1832
1832
1833
{
1833
1834
let used_links_bor = & mut used_links;
1834
1835
let mut ret = v
1835
1836
. iter ( )
1836
1837
. filter ( |i| i. inner_impl ( ) . trait_ . is_none ( ) )
1837
- . flat_map ( move |i| {
1838
- get_methods ( i. inner_impl ( ) , false , used_links_bor, false , & cx. cache )
1839
- } )
1838
+ . flat_map ( move |i| get_methods ( i. inner_impl ( ) , false , used_links_bor, false , cache) )
1840
1839
. collect :: < Vec < _ > > ( ) ;
1841
1840
if !ret. is_empty ( ) {
1842
1841
// We want links' order to be reproducible so we don't use unstable sort.
@@ -1857,7 +1856,7 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
1857
1856
if let Some ( impl_) = v
1858
1857
. iter ( )
1859
1858
. filter ( |i| i. inner_impl ( ) . trait_ . is_some ( ) )
1860
- . find ( |i| i. inner_impl ( ) . trait_ . def_id_full ( cache) == cx . cache . deref_trait_did )
1859
+ . find ( |i| i. inner_impl ( ) . trait_ . def_id_full ( cache) == cache. deref_trait_did )
1861
1860
{
1862
1861
sidebar_deref_methods ( cx, out, impl_, v) ;
1863
1862
}
@@ -2117,15 +2116,15 @@ fn sidebar_trait(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, t: &clean
2117
2116
"</div>" ,
2118
2117
) ;
2119
2118
2120
- if let Some ( implementors ) = cx. cache . implementors . get ( & it . def_id . expect_def_id ( ) ) {
2121
- let cache = cx . cache ( ) ;
2119
+ let cache = cx. cache ( ) ;
2120
+ if let Some ( implementors ) = cache. implementors . get ( & it . def_id . expect_def_id ( ) ) {
2122
2121
let mut res = implementors
2123
2122
. iter ( )
2124
2123
. filter ( |i| {
2125
2124
i. inner_impl ( )
2126
2125
. for_
2127
2126
. def_id_full ( cache)
2128
- . map_or ( false , |d| !cx . cache . paths . contains_key ( & d) )
2127
+ . map_or ( false , |d| !cache. paths . contains_key ( & d) )
2129
2128
} )
2130
2129
. filter_map ( |i| extract_for_impl_name ( & i. impl_item , cx) )
2131
2130
. collect :: < Vec < _ > > ( ) ;
0 commit comments