@@ -29,7 +29,7 @@ mod field_attr_keywords {
29
29
syn:: custom_keyword!( ignore) ;
30
30
}
31
31
32
- pub static WORLD_QUERY_DATA_ATTRIBUTE_NAME : & str = "world_query_data " ;
32
+ pub static WORLD_QUERY_DATA_ATTRIBUTE_NAME : & str = "query_data " ;
33
33
34
34
pub fn derive_world_query_data_impl ( input : TokenStream ) -> TokenStream {
35
35
let tokens = input. clone ( ) ;
@@ -137,7 +137,7 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
137
137
let Data :: Struct ( DataStruct { fields, .. } ) = & ast. data else {
138
138
return syn:: Error :: new (
139
139
Span :: call_site ( ) ,
140
- "#[derive(WorldQueryData )]` only supports structs" ,
140
+ "#[derive(QueryData )]` only supports structs" ,
141
141
)
142
142
. into_compile_error ( )
143
143
. into ( ) ;
@@ -171,7 +171,7 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
171
171
field_visibilities. push ( field. vis . clone ( ) ) ;
172
172
let field_ty = field. ty . clone ( ) ;
173
173
field_types. push ( quote ! ( #field_ty) ) ;
174
- read_only_field_types. push ( quote ! ( <#field_ty as #path:: query:: WorldQueryData >:: ReadOnly ) ) ;
174
+ read_only_field_types. push ( quote ! ( <#field_ty as #path:: query:: QueryData >:: ReadOnly ) ) ;
175
175
}
176
176
177
177
let derive_args = & attributes. derive_args ;
@@ -274,7 +274,7 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
274
274
let read_only_data_impl = if attributes. is_mutable {
275
275
quote ! {
276
276
/// SAFETY: we assert fields are readonly below
277
- unsafe impl #user_impl_generics #path:: query:: WorldQueryData
277
+ unsafe impl #user_impl_generics #path:: query:: QueryData
278
278
for #read_only_struct_name #user_ty_generics #user_where_clauses {
279
279
type ReadOnly = #read_only_struct_name #user_ty_generics;
280
280
}
@@ -285,7 +285,7 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
285
285
286
286
quote ! {
287
287
/// SAFETY: we assert fields are readonly below
288
- unsafe impl #user_impl_generics #path:: query:: WorldQueryData
288
+ unsafe impl #user_impl_generics #path:: query:: QueryData
289
289
for #struct_name #user_ty_generics #user_where_clauses {
290
290
type ReadOnly = #read_only_struct_name #user_ty_generics;
291
291
}
@@ -296,24 +296,24 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
296
296
297
297
let read_only_data_impl = quote ! {
298
298
/// SAFETY: we assert fields are readonly below
299
- unsafe impl #user_impl_generics #path:: query:: ReadOnlyWorldQueryData
299
+ unsafe impl #user_impl_generics #path:: query:: ReadOnlyQueryData
300
300
for #read_only_struct_name #user_ty_generics #user_where_clauses { }
301
301
} ;
302
302
303
303
let read_only_asserts = if attributes. is_mutable {
304
304
quote ! {
305
305
// Double-check that the data fetched by `<_ as WorldQuery>::ReadOnly` is read-only.
306
- // This is technically unnecessary as `<_ as WorldQuery>::ReadOnly: ReadOnlyWorldQueryData `
307
- // but to protect against future mistakes we assert the assoc type implements `ReadOnlyWorldQueryData ` anyway
306
+ // This is technically unnecessary as `<_ as WorldQuery>::ReadOnly: ReadOnlyQueryData `
307
+ // but to protect against future mistakes we assert the assoc type implements `ReadOnlyQueryData ` anyway
308
308
#( assert_readonly:: <#read_only_field_types>( ) ; ) *
309
309
}
310
310
} else {
311
311
quote ! {
312
- // Statically checks that the safety guarantee of `ReadOnlyWorldQueryData ` for `$fetch_struct_name` actually holds true.
313
- // We need this to make sure that we don't compile `ReadOnlyWorldQueryData ` if our struct contains nested `WorldQueryData `
312
+ // Statically checks that the safety guarantee of `ReadOnlyQueryData ` for `$fetch_struct_name` actually holds true.
313
+ // We need this to make sure that we don't compile `ReadOnlyQueryData ` if our struct contains nested `QueryData `
314
314
// members that don't implement it. I.e.:
315
315
// ```
316
- // #[derive(WorldQueryData )]
316
+ // #[derive(QueryData )]
317
317
// pub struct Foo { a: &'static mut MyComponent }
318
318
// ```
319
319
#( assert_readonly:: <#field_types>( ) ; ) *
@@ -352,13 +352,13 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
352
352
const _: ( ) = {
353
353
fn assert_readonly<T >( )
354
354
where
355
- T : #path:: query:: ReadOnlyWorldQueryData ,
355
+ T : #path:: query:: ReadOnlyQueryData ,
356
356
{
357
357
}
358
358
359
359
fn assert_data<T >( )
360
360
where
361
- T : #path:: query:: WorldQueryData ,
361
+ T : #path:: query:: QueryData ,
362
362
{
363
363
}
364
364
@@ -386,7 +386,7 @@ pub fn derive_world_query_data_impl(input: TokenStream) -> TokenStream {
386
386
}
387
387
388
388
struct WorldQueryDataFieldInfo {
389
- /// All field attributes except for `world_query_data ` ones.
389
+ /// All field attributes except for `query_data ` ones.
390
390
attrs : Vec < Attribute > ,
391
391
}
392
392
@@ -400,7 +400,7 @@ fn read_world_query_field_info(field: &Field) -> syn::Result<WorldQueryDataField
400
400
{
401
401
return Err ( syn:: Error :: new_spanned (
402
402
attr,
403
- "#[derive(WorldQueryData )] does not support field attributes." ,
403
+ "#[derive(QueryData )] does not support field attributes." ,
404
404
) ) ;
405
405
}
406
406
attrs. push ( attr. clone ( ) ) ;
0 commit comments