Skip to content

Commit 7016a9a

Browse files
committed
Fix CI warnings
1 parent 3ce4a8e commit 7016a9a

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

crates/bevy_ecs/macros/src/fetch.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ fn read_world_query_field_type_info(
529529
// If it's a mutable reference, we set `query_type` and `fetch_init_type` to `&mut T`,
530530
// we also update the lifetime for `fetch_init_type` to `'fetch`.
531531
Type::Path(path) => {
532-
assert_not_generic(&path, generic_names);
532+
assert_not_generic(path, generic_names);
533533

534534
let segment = path.path.segments.last().unwrap();
535535
let ty_ident = &segment.ident;
@@ -640,18 +640,12 @@ fn read_world_query_field_type_info(
640640
}
641641
is_phantom = true;
642642
} else if segment.ident != "Entity" {
643-
assert_not_generic(&path, generic_names);
643+
assert_not_generic(path, generic_names);
644644

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());
653648
}
654-
_ => {},
655649
}
656650

657651
// 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(
709703
_ => 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"),
710704
}
711705

712-
return WorldQueryFieldTypeInfo {
706+
WorldQueryFieldTypeInfo {
713707
query_type,
714708
fetch_init_type,
715709
is_readonly,
716710
is_phantom,
717711
readonly_types_to_assert,
718-
};
712+
}
719713
}
720714

721715
fn assert_not_generic(type_path: &TypePath, generic_names: &[String]) {

0 commit comments

Comments
 (0)