Skip to content

Commit a642c7c

Browse files
committed
chore: pick a better name for the filter WithoutAny
1 parent f18c811 commit a642c7c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/one.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,10 @@ impl<Trait: ?Sized + TraitQuery> QueryFilter for WithOne<Trait> {
858858

859859
/// [`WorldQuery`] filter for entities without any [one](crate::One) component
860860
/// implementing a trait.
861-
pub struct WithoutOne<Trait: ?Sized + TraitQuery>(PhantomData<&'static Trait>);
861+
pub struct WithoutAny<Trait: ?Sized + TraitQuery>(PhantomData<&'static Trait>);
862862

863863
// this takes inspiration from `With` in bevy's main repo
864-
unsafe impl<Trait: ?Sized + TraitQuery> WorldQuery for WithoutOne<Trait> {
864+
unsafe impl<Trait: ?Sized + TraitQuery> WorldQuery for WithoutAny<Trait> {
865865
type Item<'w> = ();
866866
type Fetch<'w> = ();
867867
type State = TraitQueryState<Trait>;
@@ -937,7 +937,7 @@ unsafe impl<Trait: ?Sized + TraitQuery> WorldQuery for WithoutOne<Trait> {
937937
}
938938

939939
/// SAFETY: read-only access
940-
impl<Trait: ?Sized + TraitQuery> QueryFilter for WithoutOne<Trait> {
940+
impl<Trait: ?Sized + TraitQuery> QueryFilter for WithoutAny<Trait> {
941941
const IS_ARCHETYPAL: bool = false;
942942
unsafe fn filter_fetch(
943943
_fetch: &mut Self::Fetch<'_>,

src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ fn without_any_filter() {
563563

564564
// Prints the entity id of every Entity where none of its components implement the trait
565565
fn print_without_any_filter_info(
566-
people: Query<Entity, WithoutOne<dyn Person>>,
566+
people: Query<Entity, WithoutAny<dyn Person>>,
567567
mut output: ResMut<Output>,
568568
) {
569569
output

0 commit comments

Comments
 (0)