@@ -451,7 +451,7 @@ impl CannotDerive<'_> {
451451}
452452
453453impl DeriveTrait {
454- fn not_by_name ( & self , ctx : & BindgenContext , item : & Item ) -> bool {
454+ fn not_by_name ( self , ctx : & BindgenContext , item : & Item ) -> bool {
455455 match self {
456456 DeriveTrait :: Copy => ctx. no_copy_by_name ( item) ,
457457 DeriveTrait :: Debug => ctx. no_debug_by_name ( item) ,
@@ -463,21 +463,21 @@ impl DeriveTrait {
463463 }
464464 }
465465
466- fn consider_edge_comp ( & self ) -> EdgePredicate {
466+ fn consider_edge_comp ( self ) -> EdgePredicate {
467467 match self {
468468 DeriveTrait :: PartialEqOrPartialOrd => consider_edge_default,
469469 _ => |kind| matches ! ( kind, EdgeKind :: BaseMember | EdgeKind :: Field ) ,
470470 }
471471 }
472472
473- fn consider_edge_typeref ( & self ) -> EdgePredicate {
473+ fn consider_edge_typeref ( self ) -> EdgePredicate {
474474 match self {
475475 DeriveTrait :: PartialEqOrPartialOrd => consider_edge_default,
476476 _ => |kind| kind == EdgeKind :: TypeReference ,
477477 }
478478 }
479479
480- fn consider_edge_tmpl_inst ( & self ) -> EdgePredicate {
480+ fn consider_edge_tmpl_inst ( self ) -> EdgePredicate {
481481 match self {
482482 DeriveTrait :: PartialEqOrPartialOrd => consider_edge_default,
483483 _ => |kind| {
@@ -489,31 +489,31 @@ impl DeriveTrait {
489489 }
490490 }
491491
492- fn can_derive_large_array ( & self , ctx : & BindgenContext ) -> bool {
492+ fn can_derive_large_array ( self , ctx : & BindgenContext ) -> bool {
493493 if ctx. options ( ) . rust_features ( ) . larger_arrays {
494494 !matches ! ( self , DeriveTrait :: Default )
495495 } else {
496496 matches ! ( self , DeriveTrait :: Copy )
497497 }
498498 }
499499
500- fn can_derive_union ( & self ) -> bool {
500+ fn can_derive_union ( self ) -> bool {
501501 matches ! ( self , DeriveTrait :: Copy )
502502 }
503503
504- fn can_derive_compound_with_destructor ( & self ) -> bool {
504+ fn can_derive_compound_with_destructor ( self ) -> bool {
505505 !matches ! ( self , DeriveTrait :: Copy )
506506 }
507507
508- fn can_derive_compound_with_vtable ( & self ) -> bool {
508+ fn can_derive_compound_with_vtable ( self ) -> bool {
509509 !matches ! ( self , DeriveTrait :: Default )
510510 }
511511
512- fn can_derive_compound_forward_decl ( & self ) -> bool {
512+ fn can_derive_compound_forward_decl ( self ) -> bool {
513513 matches ! ( self , DeriveTrait :: Copy | DeriveTrait :: Debug )
514514 }
515515
516- fn can_derive_incomplete_array ( & self ) -> bool {
516+ fn can_derive_incomplete_array ( self ) -> bool {
517517 !matches ! (
518518 self ,
519519 DeriveTrait :: Copy |
@@ -522,7 +522,7 @@ impl DeriveTrait {
522522 )
523523 }
524524
525- fn can_derive_fnptr ( & self , f : & FunctionSig ) -> CanDerive {
525+ fn can_derive_fnptr ( self , f : & FunctionSig ) -> CanDerive {
526526 match ( self , f. function_pointers_can_derive ( ) ) {
527527 ( DeriveTrait :: Copy | DeriveTrait :: Default , _) | ( _, true ) => {
528528 trace ! ( " function pointer can derive {self}" ) ;
@@ -539,8 +539,8 @@ impl DeriveTrait {
539539 }
540540 }
541541
542- fn can_derive_vector ( & self ) -> CanDerive {
543- if * self == DeriveTrait :: PartialEqOrPartialOrd {
542+ fn can_derive_vector ( self ) -> CanDerive {
543+ if self == DeriveTrait :: PartialEqOrPartialOrd {
544544 // FIXME: vectors always can derive PartialEq, but they should
545545 // not derive PartialOrd:
546546 // https://github.com/rust-lang-nursery/packed_simd/issues/48
@@ -552,8 +552,8 @@ impl DeriveTrait {
552552 }
553553 }
554554
555- fn can_derive_pointer ( & self ) -> CanDerive {
556- if * self == DeriveTrait :: Default {
555+ fn can_derive_pointer ( self ) -> CanDerive {
556+ if self == DeriveTrait :: Default {
557557 trace ! ( " pointer cannot derive Default" ) ;
558558 CanDerive :: No
559559 } else {
@@ -562,7 +562,7 @@ impl DeriveTrait {
562562 }
563563 }
564564
565- fn can_derive_simple ( & self , kind : & TypeKind ) -> CanDerive {
565+ fn can_derive_simple ( self , kind : & TypeKind ) -> CanDerive {
566566 match ( self , kind) {
567567 // === Default ===
568568 (
0 commit comments