@@ -30,7 +30,7 @@ pub use map_entities::*;
30
30
31
31
use crate :: { archetype:: ArchetypeId , storage:: SparseSetIndex } ;
32
32
use std:: {
33
- cmp:: Ordering as CmpOrdering ,
33
+ cmp:: { Ordering as CmpOrdering , PartialEq } ,
34
34
convert:: TryFrom ,
35
35
fmt,
36
36
hash:: { Hash , Hasher } ,
@@ -48,7 +48,7 @@ use std::{
48
48
/// Components of a specific entity can be accessed using
49
49
/// [`Query::get`](crate::system::Query::get) and related methods.
50
50
#[ cfg( target_endian = "little" ) ]
51
- #[ derive( Clone , Copy , Eq , PartialEq ) ]
51
+ #[ derive( Clone , Copy ) ]
52
52
#[ repr( C , align( 8 ) ) ]
53
53
pub struct Entity {
54
54
// Do not reorder the fields here. The ordering is explicitly used by repr(C)
@@ -67,7 +67,7 @@ pub struct Entity {
67
67
/// Components of a specific entity can be accessed using
68
68
/// [`Query::get`](crate::system::Query::get) and related methods.
69
69
#[ cfg( target_endian = "big" ) ]
70
- #[ derive( Clone , Copy , Eq , PartialEq ) ]
70
+ #[ derive( Clone , Copy ) ]
71
71
#[ repr( C , align( 8 ) ) ]
72
72
pub struct Entity {
73
73
// Do not reorder the fields here. The ordering is explicitly used by repr(C)
@@ -193,6 +193,14 @@ impl Hash for Entity {
193
193
}
194
194
}
195
195
196
+ impl PartialEq for Entity {
197
+ fn eq ( & self , other : & Self ) -> bool {
198
+ self . to_bits ( ) == other. to_bits ( )
199
+ }
200
+ }
201
+
202
+ impl Eq for Entity { }
203
+
196
204
impl fmt:: Debug for Entity {
197
205
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
198
206
write ! ( f, "{}v{}" , self . id, self . generation)
0 commit comments