File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ pub use crate::fallible::FromBitsError;
320320/// The types substituted for `T` and `N` must always match, creating a
321321/// `BitFlags` value where that isn't the case is considered to be impossible
322322/// without unsafe code.
323- #[ derive( Copy , Clone , Hash ) ]
323+ #[ derive( Copy , Clone , Eq , Hash ) ]
324324#[ repr( transparent) ]
325325pub struct BitFlags < T , N = <T as _internal:: RawBitFlags >:: Numeric > {
326326 val : N ,
@@ -691,13 +691,19 @@ for_each_uint! { $ty $hide_docs =>
691691 }
692692}
693693
694- impl < T , B > cmp:: PartialEq < B > for BitFlags < T >
694+ impl < T , N : PartialEq > cmp:: PartialEq for BitFlags < T , N > {
695+ #[ inline( always) ]
696+ fn eq ( & self , other : & Self ) -> bool {
697+ self . val == other. val
698+ }
699+ }
700+
701+ impl < T > cmp:: PartialEq < T > for BitFlags < T >
695702where
696703 T : BitFlag ,
697- B : Into < BitFlags < T > > + Copy ,
698704{
699705 #[ inline( always) ]
700- fn eq ( & self , other : & B ) -> bool {
706+ fn eq ( & self , other : & T ) -> bool {
701707 self . bits ( ) == Into :: < Self > :: into ( * other) . bits ( )
702708 }
703709}
You can’t perform that action at this time.
0 commit comments