@@ -529,7 +529,7 @@ fn read_world_query_field_type_info(
529
529
// If it's a mutable reference, we set `query_type` and `fetch_init_type` to `&mut T`,
530
530
// we also update the lifetime for `fetch_init_type` to `'fetch`.
531
531
Type :: Path ( path) => {
532
- assert_not_generic ( & path, generic_names) ;
532
+ assert_not_generic ( path, generic_names) ;
533
533
534
534
let segment = path. path . segments . last ( ) . unwrap ( ) ;
535
535
let ty_ident = & segment. ident ;
@@ -640,18 +640,12 @@ fn read_world_query_field_type_info(
640
640
}
641
641
is_phantom = true ;
642
642
} else if segment. ident != "Entity" {
643
- assert_not_generic ( & path, generic_names) ;
643
+ assert_not_generic ( path, generic_names) ;
644
644
645
- match & mut path_init. path . segments . last_mut ( ) . unwrap ( ) . arguments {
646
- PathArguments :: AngleBracketed ( args) => {
647
- match args. args . first_mut ( ) {
648
- Some ( GenericArgument :: Lifetime ( lt) ) => {
649
- * lt = Lifetime :: new ( "'fetch" , Span :: call_site ( ) ) ;
650
- }
651
- _ => { } ,
652
- }
645
+ if let PathArguments :: AngleBracketed ( args) = & mut path_init. path . segments . last_mut ( ) . unwrap ( ) . arguments {
646
+ if let Some ( GenericArgument :: Lifetime ( lt) ) = args. args . first_mut ( ) {
647
+ * lt = Lifetime :: new ( "'fetch" , Span :: call_site ( ) ) ;
653
648
}
654
- _ => { } ,
655
649
}
656
650
657
651
// If there's no `filter` attribute, we assume that it's a nested struct that implements `Fetch`.
@@ -709,13 +703,13 @@ fn read_world_query_field_type_info(
709
703
_ => panic ! ( "Only the following types (or their tuples) are supported for WorldQuery: &T, &mut T, Option<&T>, Option<&mut T>, Entity, or other structs that implement WorldQuery" ) ,
710
704
}
711
705
712
- return WorldQueryFieldTypeInfo {
706
+ WorldQueryFieldTypeInfo {
713
707
query_type,
714
708
fetch_init_type,
715
709
is_readonly,
716
710
is_phantom,
717
711
readonly_types_to_assert,
718
- } ;
712
+ }
719
713
}
720
714
721
715
fn assert_not_generic ( type_path : & TypePath , generic_names : & [ String ] ) {
0 commit comments