@@ -531,8 +531,9 @@ impl<'a> Iterator for Difference<'a> {
531531 type Item = usize ;
532532
533533 #[ inline]
534+ #[ allow( clippy:: manual_find) ]
534535 fn next ( & mut self ) -> Option < Self :: Item > {
535- while let Some ( nxt) = self . iter . next ( ) {
536+ for nxt in self . iter . by_ref ( ) {
536537 if !self . other . contains ( nxt) {
537538 return Some ( nxt) ;
538539 }
@@ -569,8 +570,9 @@ impl<'a> Iterator for Intersection<'a> {
569570 type Item = usize ; // the bit position of the '1'
570571
571572 #[ inline]
573+ #[ allow( clippy:: manual_find) ]
572574 fn next ( & mut self ) -> Option < Self :: Item > {
573- while let Some ( nxt) = self . iter . next ( ) {
575+ for nxt in self . iter . by_ref ( ) {
574576 if self . other . contains ( nxt) {
575577 return Some ( nxt) ;
576578 }
@@ -619,9 +621,9 @@ impl Masks {
619621 let ( last_block, last_rem) = div_rem ( end) ;
620622
621623 Masks {
622- first_block : first_block as usize ,
624+ first_block,
623625 first_mask : Block :: max_value ( ) << first_rem,
624- last_block : last_block as usize ,
626+ last_block,
625627 last_mask : ( Block :: max_value ( ) >> 1 ) >> ( BITS - last_rem - 1 ) ,
626628 // this is equivalent to `MAX >> (BITS - x)` with correct semantics when x == 0.
627629 }
@@ -669,7 +671,7 @@ impl<'a> Iterator for Ones<'a> {
669671 #[ inline]
670672 fn next ( & mut self ) -> Option < Self :: Item > {
671673 while self . bitset == 0 {
672- self . bitset = * self . remaining_blocks . next ( ) ?;
674+ self . bitset = * self . remaining_blocks . next ( ) ?;
673675 self . block_idx += BITS ;
674676 }
675677 let t = self . bitset & ( 0 as Block ) . wrapping_sub ( self . bitset ) ;
@@ -749,13 +751,13 @@ impl<'a> BitAnd for &'a FixedBitSet {
749751 }
750752}
751753
752- impl < ' a > BitAndAssign for FixedBitSet {
754+ impl BitAndAssign for FixedBitSet {
753755 fn bitand_assign ( & mut self , other : Self ) {
754756 self . intersect_with ( & other) ;
755757 }
756758}
757759
758- impl < ' a > BitAndAssign < & Self > for FixedBitSet {
760+ impl BitAndAssign < & Self > for FixedBitSet {
759761 fn bitand_assign ( & mut self , other : & Self ) {
760762 self . intersect_with ( other) ;
761763 }
@@ -780,13 +782,13 @@ impl<'a> BitOr for &'a FixedBitSet {
780782 }
781783}
782784
783- impl < ' a > BitOrAssign for FixedBitSet {
785+ impl BitOrAssign for FixedBitSet {
784786 fn bitor_assign ( & mut self , other : Self ) {
785787 self . union_with ( & other) ;
786788 }
787789}
788790
789- impl < ' a > BitOrAssign < & Self > for FixedBitSet {
791+ impl BitOrAssign < & Self > for FixedBitSet {
790792 fn bitor_assign ( & mut self , other : & Self ) {
791793 self . union_with ( other) ;
792794 }
@@ -811,13 +813,13 @@ impl<'a> BitXor for &'a FixedBitSet {
811813 }
812814}
813815
814- impl < ' a > BitXorAssign for FixedBitSet {
816+ impl BitXorAssign for FixedBitSet {
815817 fn bitxor_assign ( & mut self , other : Self ) {
816818 self . symmetric_difference_with ( & other) ;
817819 }
818820}
819821
820- impl < ' a > BitXorAssign < & Self > for FixedBitSet {
822+ impl BitXorAssign < & Self > for FixedBitSet {
821823 fn bitxor_assign ( & mut self , other : & Self ) {
822824 self . symmetric_difference_with ( other) ;
823825 }
@@ -1671,4 +1673,4 @@ fn test_is_clear() {
16711673 fb. put ( 17 ) ;
16721674 fb. put ( 19 ) ;
16731675 assert ! ( !fb. is_clear( ) ) ;
1674- }
1676+ }
0 commit comments