@@ -219,7 +219,7 @@ impl DocFolder for Cache {
219219
220220 // If this is a stripped module,
221221 // we don't want it or its children in the search index.
222- let orig_stripped_mod = match item. kind {
222+ let orig_stripped_mod = match * item. kind {
223223 clean:: StrippedItem ( box clean:: ModuleItem ( ..) ) => {
224224 mem:: replace ( & mut self . stripped_mod , true )
225225 }
@@ -228,7 +228,7 @@ impl DocFolder for Cache {
228228
229229 // If the impl is from a masked crate or references something from a
230230 // masked crate then remove it completely.
231- if let clean:: ImplItem ( ref i) = item. kind {
231+ if let clean:: ImplItem ( ref i) = * item. kind {
232232 if self . masked_crates . contains ( & item. def_id . krate )
233233 || i. trait_ . def_id ( ) . map_or ( false , |d| self . masked_crates . contains ( & d. krate ) )
234234 || i. for_ . def_id ( ) . map_or ( false , |d| self . masked_crates . contains ( & d. krate ) )
@@ -239,12 +239,12 @@ impl DocFolder for Cache {
239239
240240 // Propagate a trait method's documentation to all implementors of the
241241 // trait.
242- if let clean:: TraitItem ( ref t) = item. kind {
242+ if let clean:: TraitItem ( ref t) = * item. kind {
243243 self . traits . entry ( item. def_id ) . or_insert_with ( || t. clone ( ) ) ;
244244 }
245245
246246 // Collect all the implementors of traits.
247- if let clean:: ImplItem ( ref i) = item. kind {
247+ if let clean:: ImplItem ( ref i) = * item. kind {
248248 if let Some ( did) = i. trait_ . def_id ( ) {
249249 if i. blanket_impl . is_none ( ) {
250250 self . implementors
@@ -257,7 +257,7 @@ impl DocFolder for Cache {
257257
258258 // Index this method for searching later on.
259259 if let Some ( ref s) = item. name {
260- let ( parent, is_inherent_impl_item) = match item. kind {
260+ let ( parent, is_inherent_impl_item) = match * item. kind {
261261 clean:: StrippedItem ( ..) => ( ( None , None ) , false ) ,
262262 clean:: AssocConstItem ( ..) | clean:: TypedefItem ( _, true )
263263 if self . parent_is_trait_impl =>
@@ -348,7 +348,7 @@ impl DocFolder for Cache {
348348 _ => false ,
349349 } ;
350350
351- match item. kind {
351+ match * item. kind {
352352 clean:: StructItem ( ..)
353353 | clean:: EnumItem ( ..)
354354 | clean:: TypedefItem ( ..)
@@ -387,7 +387,7 @@ impl DocFolder for Cache {
387387
388388 // Maintain the parent stack
389389 let orig_parent_is_trait_impl = self . parent_is_trait_impl ;
390- let parent_pushed = match item. kind {
390+ let parent_pushed = match * item. kind {
391391 clean:: TraitItem ( ..)
392392 | clean:: EnumItem ( ..)
393393 | clean:: ForeignTypeItem
@@ -425,38 +425,33 @@ impl DocFolder for Cache {
425425 // Once we've recursively found all the generics, hoard off all the
426426 // implementations elsewhere.
427427 let item = self . fold_item_recur ( item) ;
428- let ret = if let clean:: Item { kind : clean:: ImplItem ( _ ) , .. } = item {
428+ let ret = if let clean:: Item { kind : box clean:: ImplItem ( ref i ) , .. } = item {
429429 // Figure out the id of this impl. This may map to a
430430 // primitive rather than always to a struct/enum.
431431 // Note: matching twice to restrict the lifetime of the `i` borrow.
432432 let mut dids = FxHashSet :: default ( ) ;
433- if let clean:: Item { kind : clean:: ImplItem ( ref i) , .. } = item {
434- match i. for_ {
435- clean:: ResolvedPath { did, .. }
436- | clean:: BorrowedRef { type_ : box clean:: ResolvedPath { did, .. } , .. } => {
437- dids. insert ( did) ;
438- }
439- ref t => {
440- let did = t
441- . primitive_type ( )
442- . and_then ( |t| self . primitive_locations . get ( & t) . cloned ( ) ) ;
433+ match i. for_ {
434+ clean:: ResolvedPath { did, .. }
435+ | clean:: BorrowedRef { type_ : box clean:: ResolvedPath { did, .. } , .. } => {
436+ dids. insert ( did) ;
437+ }
438+ ref t => {
439+ let did =
440+ t. primitive_type ( ) . and_then ( |t| self . primitive_locations . get ( & t) . cloned ( ) ) ;
443441
444- if let Some ( did) = did {
445- dids. insert ( did) ;
446- }
442+ if let Some ( did) = did {
443+ dids. insert ( did) ;
447444 }
448445 }
446+ }
449447
450- if let Some ( generics) = i. trait_ . as_ref ( ) . and_then ( |t| t. generics ( ) ) {
451- for bound in generics {
452- if let Some ( did) = bound. def_id ( ) {
453- dids. insert ( did) ;
454- }
448+ if let Some ( generics) = i. trait_ . as_ref ( ) . and_then ( |t| t. generics ( ) ) {
449+ for bound in generics {
450+ if let Some ( did) = bound. def_id ( ) {
451+ dids. insert ( did) ;
455452 }
456453 }
457- } else {
458- unreachable ! ( )
459- } ;
454+ }
460455 let impl_item = Impl { impl_item : item } ;
461456 if impl_item. trait_did ( ) . map_or ( true , |d| self . traits . contains_key ( & d) ) {
462457 for did in dids {
0 commit comments