@@ -219,7 +219,7 @@ impl DocFolder for Cache {
219
219
220
220
// If this is a stripped module,
221
221
// 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 {
223
223
clean:: StrippedItem ( box clean:: ModuleItem ( ..) ) => {
224
224
mem:: replace ( & mut self . stripped_mod , true )
225
225
}
@@ -228,7 +228,7 @@ impl DocFolder for Cache {
228
228
229
229
// If the impl is from a masked crate or references something from a
230
230
// masked crate then remove it completely.
231
- if let clean:: ImplItem ( ref i) = item. kind {
231
+ if let clean:: ImplItem ( ref i) = * item. kind {
232
232
if self . masked_crates . contains ( & item. def_id . krate )
233
233
|| i. trait_ . def_id ( ) . map_or ( false , |d| self . masked_crates . contains ( & d. krate ) )
234
234
|| i. for_ . def_id ( ) . map_or ( false , |d| self . masked_crates . contains ( & d. krate ) )
@@ -239,12 +239,12 @@ impl DocFolder for Cache {
239
239
240
240
// Propagate a trait method's documentation to all implementors of the
241
241
// trait.
242
- if let clean:: TraitItem ( ref t) = item. kind {
242
+ if let clean:: TraitItem ( ref t) = * item. kind {
243
243
self . traits . entry ( item. def_id ) . or_insert_with ( || t. clone ( ) ) ;
244
244
}
245
245
246
246
// Collect all the implementors of traits.
247
- if let clean:: ImplItem ( ref i) = item. kind {
247
+ if let clean:: ImplItem ( ref i) = * item. kind {
248
248
if let Some ( did) = i. trait_ . def_id ( ) {
249
249
if i. blanket_impl . is_none ( ) {
250
250
self . implementors
@@ -257,7 +257,7 @@ impl DocFolder for Cache {
257
257
258
258
// Index this method for searching later on.
259
259
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 {
261
261
clean:: StrippedItem ( ..) => ( ( None , None ) , false ) ,
262
262
clean:: AssocConstItem ( ..) | clean:: TypedefItem ( _, true )
263
263
if self . parent_is_trait_impl =>
@@ -348,7 +348,7 @@ impl DocFolder for Cache {
348
348
_ => false ,
349
349
} ;
350
350
351
- match item. kind {
351
+ match * item. kind {
352
352
clean:: StructItem ( ..)
353
353
| clean:: EnumItem ( ..)
354
354
| clean:: TypedefItem ( ..)
@@ -387,7 +387,7 @@ impl DocFolder for Cache {
387
387
388
388
// Maintain the parent stack
389
389
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 {
391
391
clean:: TraitItem ( ..)
392
392
| clean:: EnumItem ( ..)
393
393
| clean:: ForeignTypeItem
@@ -425,38 +425,33 @@ impl DocFolder for Cache {
425
425
// Once we've recursively found all the generics, hoard off all the
426
426
// implementations elsewhere.
427
427
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 {
429
429
// Figure out the id of this impl. This may map to a
430
430
// primitive rather than always to a struct/enum.
431
431
// Note: matching twice to restrict the lifetime of the `i` borrow.
432
432
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 ( ) ) ;
443
441
444
- if let Some ( did) = did {
445
- dids. insert ( did) ;
446
- }
442
+ if let Some ( did) = did {
443
+ dids. insert ( did) ;
447
444
}
448
445
}
446
+ }
449
447
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) ;
455
452
}
456
453
}
457
- } else {
458
- unreachable ! ( )
459
- } ;
454
+ }
460
455
let impl_item = Impl { impl_item : item } ;
461
456
if impl_item. trait_did ( ) . map_or ( true , |d| self . traits . contains_key ( & d) ) {
462
457
for did in dids {
0 commit comments