@@ -1012,11 +1012,11 @@ fn render_assoc_items(
10121012 what : AssocItemRender < ' _ > ,
10131013) {
10141014 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) {
10161017 Some ( v) => v,
10171018 None => return ,
10181019 } ;
1019- let cache = cx. cache ( ) ;
10201020 let ( non_trait, traits) : ( Vec < _ > , _ ) = v. iter ( ) . partition ( |i| i. inner_impl ( ) . trait_ . is_none ( ) ) ;
10211021 if !non_trait. is_empty ( ) {
10221022 let render_mode = match what {
@@ -1063,11 +1063,11 @@ fn render_assoc_items(
10631063 if !traits. is_empty ( ) {
10641064 let deref_impl = traits
10651065 . 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 ) ;
10671067 if let Some ( impl_) = deref_impl {
10681068 let has_deref_mut = traits
10691069 . 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 ) ;
10711071 render_deref_methods ( w, cx, impl_, containing_item, has_deref_mut) ;
10721072 }
10731073 let ( synthetic, concrete) : ( Vec < & & Impl > , Vec < & & Impl > ) =
@@ -1122,6 +1122,7 @@ fn render_deref_methods(
11221122 container_item : & clean:: Item ,
11231123 deref_mut : bool ,
11241124) {
1125+ let cache = cx. cache ( ) ;
11251126 let deref_type = impl_. inner_impl ( ) . trait_ . as_ref ( ) . unwrap ( ) ;
11261127 let ( target, real_target) = impl_
11271128 . inner_impl ( )
@@ -1138,8 +1139,8 @@ fn render_deref_methods(
11381139 debug ! ( "Render deref methods for {:#?}, target {:#?}" , impl_. inner_impl( ) . for_, target) ;
11391140 let what =
11401141 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) {
11431144 // `impl Deref<Target = S> for S`
11441145 if did == type_did {
11451146 // Avoid infinite cycles
@@ -1149,7 +1150,7 @@ fn render_deref_methods(
11491150 render_assoc_items ( w, cx, container_item, did, what) ;
11501151 } else {
11511152 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) {
11531154 render_assoc_items ( w, cx, container_item, did, what) ;
11541155 }
11551156 }
@@ -1286,7 +1287,7 @@ fn render_impl(
12861287 let render_method_item = match render_mode {
12871288 RenderMode :: Normal => true ,
12881289 RenderMode :: ForDeref { mut_ : deref_mut_ } => {
1289- should_render_item ( & item, deref_mut_, & cx. cache )
1290+ should_render_item ( & item, deref_mut_, cx. cache ( ) )
12901291 }
12911292 } ;
12921293
@@ -1678,7 +1679,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
16781679 }
16791680
16801681 if it. is_crate ( ) {
1681- if let Some ( ref version) = cx. cache . crate_version {
1682+ if let Some ( ref version) = cx. cache ( ) . crate_version {
16821683 write ! (
16831684 buffer,
16841685 "<div class=\" block version\" >\
@@ -1825,18 +1826,16 @@ fn small_url_encode(s: String) -> String {
18251826
18261827fn sidebar_assoc_items ( cx : & Context < ' _ > , out : & mut Buffer , it : & clean:: Item ) {
18271828 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) {
18291831 let mut used_links = FxHashSet :: default ( ) ;
1830- let cache = cx. cache ( ) ;
18311832
18321833 {
18331834 let used_links_bor = & mut used_links;
18341835 let mut ret = v
18351836 . iter ( )
18361837 . 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) )
18401839 . collect :: < Vec < _ > > ( ) ;
18411840 if !ret. is_empty ( ) {
18421841 // 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) {
18571856 if let Some ( impl_) = v
18581857 . iter ( )
18591858 . 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 )
18611860 {
18621861 sidebar_deref_methods ( cx, out, impl_, v) ;
18631862 }
@@ -2117,15 +2116,15 @@ fn sidebar_trait(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item, t: &clean
21172116 "</div>" ,
21182117 ) ;
21192118
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 ( ) ) {
21222121 let mut res = implementors
21232122 . iter ( )
21242123 . filter ( |i| {
21252124 i. inner_impl ( )
21262125 . for_
21272126 . 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) )
21292128 } )
21302129 . filter_map ( |i| extract_for_impl_name ( & i. impl_item , cx) )
21312130 . collect :: < Vec < _ > > ( ) ;
0 commit comments