Skip to content

Commit 6e7b935

Browse files
committed
chore: pick a better name for the filter WithoutAny
1 parent b68f786 commit 6e7b935

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
@@ -853,10 +853,10 @@ impl<Trait: ?Sized + TraitQuery> QueryFilter for WithOne<Trait> {
853853

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

858858
// this takes inspiration from `With` in bevy's main repo
859-
unsafe impl<Trait: ?Sized + TraitQuery> WorldQuery for WithoutOne<Trait> {
859+
unsafe impl<Trait: ?Sized + TraitQuery> WorldQuery for WithoutAny<Trait> {
860860
type Item<'w> = ();
861861
type Fetch<'w> = ();
862862
type State = TraitQueryState<Trait>;
@@ -932,7 +932,7 @@ unsafe impl<Trait: ?Sized + TraitQuery> WorldQuery for WithoutOne<Trait> {
932932
}
933933

934934
/// SAFETY: read-only access
935-
impl<Trait: ?Sized + TraitQuery> QueryFilter for WithoutOne<Trait> {
935+
impl<Trait: ?Sized + TraitQuery> QueryFilter for WithoutAny<Trait> {
936936
const IS_ARCHETYPAL: bool = false;
937937
unsafe fn filter_fetch(
938938
_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)