Skip to content

Commit c052054

Browse files
committed
fix test
1 parent 3890ea9 commit c052054

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

crates/bevy_ecs/src/world/entity_ref.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5174,10 +5174,9 @@ mod tests {
51745174

51755175
fn system(_: Query<&mut TestComponent>, query: Query<EntityRefExcept<TestComponent>>) {
51765176
for entity_ref in query.iter() {
5177-
assert!(matches!(
5178-
entity_ref.get::<TestComponent2>(),
5179-
Some(TestComponent2(0))
5180-
));
5177+
if let Some(c) = entity_ref.get::<TestComponent2>() {
5178+
assert!(c.0 == 0);
5179+
}
51815180
}
51825181
}
51835182
}
@@ -5197,10 +5196,9 @@ mod tests {
51975196
assert!(entity_mut.get::<TestComponent>().is_none());
51985197
assert!(entity_mut.get_ref::<TestComponent>().is_none());
51995198
assert!(entity_mut.get_mut::<TestComponent>().is_none());
5200-
assert!(matches!(
5201-
entity_mut.get::<TestComponent2>(),
5202-
Some(TestComponent2(0))
5203-
));
5199+
if let Some(c) = entity_mut.get::<TestComponent2>() {
5200+
assert!(c.0 == 0);
5201+
}
52045202
}
52055203

52065204
assert!(found);

0 commit comments

Comments
 (0)