From 0bfb7f5311ac6d6650754048fd5cdedca5d91e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Thu, 21 Oct 2021 18:15:11 +0200 Subject: [PATCH 1/6] update edition to 2021 --- Cargo.toml | 2 +- benches/Cargo.toml | 2 +- crates/bevy_app/Cargo.toml | 2 +- crates/bevy_asset/Cargo.toml | 2 +- crates/bevy_audio/Cargo.toml | 2 +- crates/bevy_core/Cargo.toml | 2 +- crates/bevy_derive/Cargo.toml | 2 +- crates/bevy_diagnostic/Cargo.toml | 2 +- crates/bevy_dylib/Cargo.toml | 2 +- crates/bevy_dynamic_plugin/Cargo.toml | 2 +- crates/bevy_ecs/Cargo.toml | 2 +- crates/bevy_ecs/macros/Cargo.toml | 2 +- crates/bevy_gilrs/Cargo.toml | 2 +- crates/bevy_gltf/Cargo.toml | 2 +- crates/bevy_input/Cargo.toml | 2 +- crates/bevy_internal/Cargo.toml | 2 +- crates/bevy_log/Cargo.toml | 2 +- crates/bevy_macro_utils/Cargo.toml | 2 +- crates/bevy_math/Cargo.toml | 2 +- crates/bevy_pbr/Cargo.toml | 2 +- crates/bevy_reflect/Cargo.toml | 2 +- crates/bevy_reflect/bevy_reflect_derive/Cargo.toml | 2 +- crates/bevy_render/Cargo.toml | 2 +- crates/bevy_scene/Cargo.toml | 2 +- crates/bevy_sprite/Cargo.toml | 2 +- crates/bevy_tasks/Cargo.toml | 2 +- crates/bevy_text/Cargo.toml | 2 +- crates/bevy_transform/Cargo.toml | 2 +- crates/bevy_ui/Cargo.toml | 2 +- crates/bevy_utils/Cargo.toml | 2 +- crates/bevy_wgpu/Cargo.toml | 2 +- crates/bevy_window/Cargo.toml | 2 +- crates/bevy_winit/Cargo.toml | 2 +- examples/ios/Cargo.toml | 2 +- pipelined/bevy_core_pipeline/Cargo.toml | 2 +- pipelined/bevy_gltf2/Cargo.toml | 2 +- pipelined/bevy_pbr2/Cargo.toml | 2 +- pipelined/bevy_render2/Cargo.toml | 2 +- pipelined/bevy_sprite2/Cargo.toml | 2 +- tools/ci/Cargo.toml | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a4dca68a095b..3ddbb73b6575c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/benches/Cargo.toml b/benches/Cargo.toml index 3d13d202eff82..6e2ff0a9a1884 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Bevy Contributors ", "Carter Anderson ", ] -edition = "2018" +edition = "2021" [dev-dependencies] criterion = "0.3" diff --git a/crates/bevy_app/Cargo.toml b/crates/bevy_app/Cargo.toml index 58e8ac243e79c..5d99e47200748 100644 --- a/crates/bevy_app/Cargo.toml +++ b/crates/bevy_app/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_app" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml index a1fede4dfabe1..c4fee0cba8af9 100644 --- a/crates/bevy_asset/Cargo.toml +++ b/crates/bevy_asset/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_asset" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_audio/Cargo.toml b/crates/bevy_audio/Cargo.toml index e5d9b02163e76..d84f389e401b2 100644 --- a/crates/bevy_audio/Cargo.toml +++ b/crates/bevy_audio/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_audio" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_core/Cargo.toml b/crates/bevy_core/Cargo.toml index ef6283e890aff..a0b5539c2e27f 100644 --- a/crates/bevy_core/Cargo.toml +++ b/crates/bevy_core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_core" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_derive/Cargo.toml b/crates/bevy_derive/Cargo.toml index 2729d6f1076b3..eacd576654c14 100644 --- a/crates/bevy_derive/Cargo.toml +++ b/crates/bevy_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_derive" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_diagnostic/Cargo.toml b/crates/bevy_diagnostic/Cargo.toml index 83b234b01dd81..e16df10edff5d 100644 --- a/crates/bevy_diagnostic/Cargo.toml +++ b/crates/bevy_diagnostic/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_diagnostic" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_dylib/Cargo.toml b/crates/bevy_dylib/Cargo.toml index cb424f6673a62..3d5c073ab115a 100644 --- a/crates/bevy_dylib/Cargo.toml +++ b/crates/bevy_dylib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_dylib" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_dynamic_plugin/Cargo.toml b/crates/bevy_dynamic_plugin/Cargo.toml index 99589c7cc94b9..2749f84b7b4e1 100644 --- a/crates/bevy_dynamic_plugin/Cargo.toml +++ b/crates/bevy_dynamic_plugin/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Bevy Contributors ", "Carter Anderson ", ] -edition = "2018" +edition = "2021" description = "Provides dynamic plugin loading capabilities for non-wasm platforms" homepage = "https://bevyengine.org" repository = "https://github.com/bevyengine/bevy" diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml index 00010a15252e0..1f65bb358accf 100644 --- a/crates/bevy_ecs/Cargo.toml +++ b/crates/bevy_ecs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_ecs" version = "0.5.0" -edition = "2018" +edition = "2021" description = "Bevy Engine's entity component system" homepage = "https://bevyengine.org" repository = "https://github.com/bevyengine/bevy" diff --git a/crates/bevy_ecs/macros/Cargo.toml b/crates/bevy_ecs/macros/Cargo.toml index 78f882dead7d4..69c988afa9481 100644 --- a/crates/bevy_ecs/macros/Cargo.toml +++ b/crates/bevy_ecs/macros/Cargo.toml @@ -2,7 +2,7 @@ name = "bevy_ecs_macros" version = "0.5.0" description = "Bevy ECS Macros" -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" [lib] diff --git a/crates/bevy_gilrs/Cargo.toml b/crates/bevy_gilrs/Cargo.toml index e913abb9b9d7b..dc3b21bcff1bb 100644 --- a/crates/bevy_gilrs/Cargo.toml +++ b/crates/bevy_gilrs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_gilrs" version = "0.5.0" -edition = "2018" +edition = "2021" authors = ["Bevy Contributors ", "Carter Anderson "] description = "Gamepad system made using Gilrs for Bevy Engine" homepage = "https://bevyengine.org" diff --git a/crates/bevy_gltf/Cargo.toml b/crates/bevy_gltf/Cargo.toml index b94c04d66450f..767382dc9b816 100644 --- a/crates/bevy_gltf/Cargo.toml +++ b/crates/bevy_gltf/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_gltf" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_input/Cargo.toml b/crates/bevy_input/Cargo.toml index fdd442b612281..d231ba12e971a 100644 --- a/crates/bevy_input/Cargo.toml +++ b/crates/bevy_input/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_input" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index 94a659cf68ac0..f2df1808dcaea 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_internal" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_log/Cargo.toml b/crates/bevy_log/Cargo.toml index 0dee0feab4a3f..5ad3da9d91495 100644 --- a/crates/bevy_log/Cargo.toml +++ b/crates/bevy_log/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_log" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_macro_utils/Cargo.toml b/crates/bevy_macro_utils/Cargo.toml index b92056f642455..5f7adb6f3fce6 100644 --- a/crates/bevy_macro_utils/Cargo.toml +++ b/crates/bevy_macro_utils/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_macro_utils" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_math/Cargo.toml b/crates/bevy_math/Cargo.toml index 109229b870f78..d195c6f1e8339 100644 --- a/crates/bevy_math/Cargo.toml +++ b/crates/bevy_math/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_math" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_pbr/Cargo.toml b/crates/bevy_pbr/Cargo.toml index 38f08920e9d2b..71951fa39753f 100644 --- a/crates/bevy_pbr/Cargo.toml +++ b/crates/bevy_pbr/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_pbr" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_reflect/Cargo.toml b/crates/bevy_reflect/Cargo.toml index 1f0e81e050939..9fb4c4ca1ff5b 100644 --- a/crates/bevy_reflect/Cargo.toml +++ b/crates/bevy_reflect/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_reflect" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml b/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml index 1836607e1be26..8427d26c1d5a2 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml +++ b/crates/bevy_reflect/bevy_reflect_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_reflect_derive" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index c18b6ed307990..1752c34d68d52 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_render" version = "0.5.0" -edition = "2018" +edition = "2021" description = "Provides rendering functionality for Bevy Engine" homepage = "https://bevyengine.org" repository = "https://github.com/bevyengine/bevy" diff --git a/crates/bevy_scene/Cargo.toml b/crates/bevy_scene/Cargo.toml index 3c555b2a8e85a..0711c63745171 100644 --- a/crates/bevy_scene/Cargo.toml +++ b/crates/bevy_scene/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_scene" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_sprite/Cargo.toml b/crates/bevy_sprite/Cargo.toml index 13689a1686fba..ca37ce6fddfe5 100644 --- a/crates/bevy_sprite/Cargo.toml +++ b/crates/bevy_sprite/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_sprite" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_tasks/Cargo.toml b/crates/bevy_tasks/Cargo.toml index 876d1482c9087..c7090c337fafb 100644 --- a/crates/bevy_tasks/Cargo.toml +++ b/crates/bevy_tasks/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_tasks" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Lachlan Sneff ", diff --git a/crates/bevy_text/Cargo.toml b/crates/bevy_text/Cargo.toml index f4be2c9a855db..613e50f93be40 100644 --- a/crates/bevy_text/Cargo.toml +++ b/crates/bevy_text/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_text" version = "0.5.0" -edition = "2018" +edition = "2021" description = "Provides text functionality for Bevy Engine" homepage = "https://bevyengine.org" repository = "https://github.com/bevyengine/bevy" diff --git a/crates/bevy_transform/Cargo.toml b/crates/bevy_transform/Cargo.toml index eec5f362152c7..ad93b045b147e 100644 --- a/crates/bevy_transform/Cargo.toml +++ b/crates/bevy_transform/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_transform" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_ui/Cargo.toml b/crates/bevy_ui/Cargo.toml index 07e653d83447d..07f23d03da96f 100644 --- a/crates/bevy_ui/Cargo.toml +++ b/crates/bevy_ui/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_ui" version = "0.5.0" -edition = "2018" +edition = "2021" description = "A custom ECS-driven UI framework built specifically for Bevy Engine" homepage = "https://bevyengine.org" repository = "https://github.com/bevyengine/bevy" diff --git a/crates/bevy_utils/Cargo.toml b/crates/bevy_utils/Cargo.toml index d98ab41e6c747..f8c1115e728bd 100644 --- a/crates/bevy_utils/Cargo.toml +++ b/crates/bevy_utils/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_utils" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_wgpu/Cargo.toml b/crates/bevy_wgpu/Cargo.toml index b2f240b560753..9969b1869df55 100644 --- a/crates/bevy_wgpu/Cargo.toml +++ b/crates/bevy_wgpu/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_wgpu" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_window/Cargo.toml b/crates/bevy_window/Cargo.toml index ac2617feb15e2..4eb4fcbbfb569 100644 --- a/crates/bevy_window/Cargo.toml +++ b/crates/bevy_window/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_window" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/crates/bevy_winit/Cargo.toml b/crates/bevy_winit/Cargo.toml index 53e64008715bd..ce02180ad636d 100644 --- a/crates/bevy_winit/Cargo.toml +++ b/crates/bevy_winit/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_winit" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/examples/ios/Cargo.toml b/examples/ios/Cargo.toml index 06a9baa5839c0..8159df555ecdd 100644 --- a/examples/ios/Cargo.toml +++ b/examples/ios/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy-ios-example" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] name = "bevy_ios_example" diff --git a/pipelined/bevy_core_pipeline/Cargo.toml b/pipelined/bevy_core_pipeline/Cargo.toml index 4f4ac0e2fed5f..35dec3902346f 100644 --- a/pipelined/bevy_core_pipeline/Cargo.toml +++ b/pipelined/bevy_core_pipeline/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_core_pipeline" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/pipelined/bevy_gltf2/Cargo.toml b/pipelined/bevy_gltf2/Cargo.toml index a5efe4753b53e..080d0043344bf 100644 --- a/pipelined/bevy_gltf2/Cargo.toml +++ b/pipelined/bevy_gltf2/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_gltf2" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/pipelined/bevy_pbr2/Cargo.toml b/pipelined/bevy_pbr2/Cargo.toml index 21bf192169579..ea1a538c0095c 100644 --- a/pipelined/bevy_pbr2/Cargo.toml +++ b/pipelined/bevy_pbr2/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_pbr2" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/pipelined/bevy_render2/Cargo.toml b/pipelined/bevy_render2/Cargo.toml index a1bb1fbc66b89..694b500e3d439 100644 --- a/pipelined/bevy_render2/Cargo.toml +++ b/pipelined/bevy_render2/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_render2" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/pipelined/bevy_sprite2/Cargo.toml b/pipelined/bevy_sprite2/Cargo.toml index 3a1a3fd9ccf00..8f5f81d52e62e 100644 --- a/pipelined/bevy_sprite2/Cargo.toml +++ b/pipelined/bevy_sprite2/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_sprite2" version = "0.5.0" -edition = "2018" +edition = "2021" authors = [ "Bevy Contributors ", "Carter Anderson ", diff --git a/tools/ci/Cargo.toml b/tools/ci/Cargo.toml index cea60163c5c65..f8ccbb5bb193c 100644 --- a/tools/ci/Cargo.toml +++ b/tools/ci/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Bevy Contributors ", "Nathan Stocks " ] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 5b247db29584396a69b55aed83ff2de6063ee5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Thu, 21 Oct 2021 18:15:25 +0200 Subject: [PATCH 2/6] no need to specified resolver version anymore --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3ddbb73b6575c..2d68287a14fa8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"] license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/bevyengine/bevy" -resolver = "2" [workspace] exclude = ["benches"] From d072ca46c3b96b97ee8b7d5d288d7b6ecf27c727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Thu, 21 Oct 2021 18:15:38 +0200 Subject: [PATCH 3/6] update for new reserved syntax --- crates/bevy_derive/src/enum_variant_meta.rs | 2 +- crates/bevy_derive/src/resource.rs | 2 +- crates/bevy_derive/src/shader_defs.rs | 2 +- crates/bevy_ecs/macros/src/lib.rs | 6 +++--- .../bevy_reflect/bevy_reflect_derive/src/lib.rs | 16 ++++++++-------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/bevy_derive/src/enum_variant_meta.rs b/crates/bevy_derive/src/enum_variant_meta.rs index 66ed1f0ff7d2a..ae0c26d2ead33 100644 --- a/crates/bevy_derive/src/enum_variant_meta.rs +++ b/crates/bevy_derive/src/enum_variant_meta.rs @@ -21,7 +21,7 @@ pub fn derive_enum_variant_meta(input: TokenStream) -> TokenStream { let indices = 0..names.len(); TokenStream::from(quote! { - impl #impl_generics #bevy_util_path::EnumVariantMeta for #struct_name#ty_generics #where_clause { + impl #impl_generics #bevy_util_path::EnumVariantMeta for #struct_name #ty_generics #where_clause { fn enum_variant_index(&self) -> usize { match self { #(#struct_name::#idents {..} => #indices,)* diff --git a/crates/bevy_derive/src/resource.rs b/crates/bevy_derive/src/resource.rs index 110b5605ca6d4..242f1ba230e01 100644 --- a/crates/bevy_derive/src/resource.rs +++ b/crates/bevy_derive/src/resource.rs @@ -21,7 +21,7 @@ pub fn derive_from_resources(input: TokenStream) -> TokenStream { let struct_name = &ast.ident; TokenStream::from(quote! { - impl #impl_generics #bevy_app_path::FromResources for #struct_name#ty_generics { + impl #impl_generics #bevy_app_path::FromResources for #struct_name #ty_generics { fn from_resources(resources: &Resources) -> Self { use #bevy_app_path::FromResources; #struct_name { diff --git a/crates/bevy_derive/src/shader_defs.rs b/crates/bevy_derive/src/shader_defs.rs index 4596667b6a1a4..c78f660404164 100644 --- a/crates/bevy_derive/src/shader_defs.rs +++ b/crates/bevy_derive/src/shader_defs.rs @@ -40,7 +40,7 @@ pub fn derive_shader_defs(input: TokenStream) -> TokenStream { let (impl_generics, ty_generics, _where_clause) = generics.split_for_impl(); TokenStream::from(quote! { - impl #impl_generics #bevy_render_path::shader::ShaderDefs for #struct_name#ty_generics { + impl #impl_generics #bevy_render_path::shader::ShaderDefs for #struct_name #ty_generics { fn shader_defs_len(&self) -> usize { #shader_defs_len } diff --git a/crates/bevy_ecs/macros/src/lib.rs b/crates/bevy_ecs/macros/src/lib.rs index 8371de3e4b160..26579bb4bec3d 100644 --- a/crates/bevy_ecs/macros/src/lib.rs +++ b/crates/bevy_ecs/macros/src/lib.rs @@ -146,7 +146,7 @@ pub fn derive_bundle(input: TokenStream) -> TokenStream { TokenStream::from(quote! { /// SAFE: TypeInfo is returned in field-definition-order. [from_components] and [get_components] use field-definition-order - unsafe impl #impl_generics #ecs_path::bundle::Bundle for #struct_name#ty_generics #where_clause { + unsafe impl #impl_generics #ecs_path::bundle::Bundle for #struct_name #ty_generics #where_clause { fn component_ids( components: &mut #ecs_path::component::Components, ) -> Vec<#ecs_path::component::ComponentId> { @@ -374,7 +374,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream { let fetch_struct_visibility = &ast.vis; TokenStream::from(quote! { - impl #impl_generics #path::system::SystemParam for #struct_name#ty_generics #where_clause { + impl #impl_generics #path::system::SystemParam for #struct_name #ty_generics #where_clause { type Fetch = #fetch_struct_name <(#(<#field_types as #path::system::SystemParam>::Fetch,)*), #punctuated_generic_idents>; } @@ -407,7 +407,7 @@ pub fn derive_system_param(input: TokenStream) -> TokenStream { } impl #impl_generics #path::system::SystemParamFetch<'w, 's> for #fetch_struct_name <(#(<#field_types as #path::system::SystemParam>::Fetch,)*), #punctuated_generic_idents> { - type Item = #struct_name#ty_generics; + type Item = #struct_name #ty_generics; unsafe fn get_param( state: &'s mut Self, system_meta: &#path::system::SystemMeta, diff --git a/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs b/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs index 0066f5a10d52e..1a5cce05ce496 100644 --- a/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs +++ b/crates/bevy_reflect/bevy_reflect_derive/src/lib.rs @@ -206,7 +206,7 @@ fn impl_struct( TokenStream::from(quote! { #get_type_registration_impl - impl #impl_generics #bevy_reflect_path::Struct for #struct_name#ty_generics #where_clause { + impl #impl_generics #bevy_reflect_path::Struct for #struct_name #ty_generics #where_clause { fn field(&self, name: &str) -> Option<&dyn #bevy_reflect_path::Reflect> { match name { #(#field_names => Some(&self.#field_idents),)* @@ -259,7 +259,7 @@ fn impl_struct( } // SAFE: any and any_mut both return self - unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name#ty_generics #where_clause { + unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name #ty_generics #where_clause { #[inline] fn type_name(&self) -> &str { std::any::type_name::() @@ -349,7 +349,7 @@ fn impl_tuple_struct( TokenStream::from(quote! { #get_type_registration_impl - impl #impl_generics #bevy_reflect_path::TupleStruct for #struct_name#ty_generics { + impl #impl_generics #bevy_reflect_path::TupleStruct for #struct_name #ty_generics { fn field(&self, index: usize) -> Option<&dyn #bevy_reflect_path::Reflect> { match index { #(#field_indices => Some(&self.#field_idents),)* @@ -381,7 +381,7 @@ fn impl_tuple_struct( } // SAFE: any and any_mut both return self - unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name#ty_generics { + unsafe impl #impl_generics #bevy_reflect_path::Reflect for #struct_name #ty_generics { #[inline] fn type_name(&self) -> &str { std::any::type_name::() @@ -457,7 +457,7 @@ fn impl_value( #get_type_registration_impl // SAFE: any and any_mut both return self - unsafe impl #impl_generics #bevy_reflect_path::Reflect for #type_name#ty_generics #where_clause { + unsafe impl #impl_generics #bevy_reflect_path::Reflect for #type_name #ty_generics #where_clause { #[inline] fn type_name(&self) -> &str { std::any::type_name::() @@ -717,10 +717,10 @@ fn impl_get_type_registration( let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); quote! { #[allow(unused_mut)] - impl #impl_generics #bevy_reflect_path::GetTypeRegistration for #type_name#ty_generics #where_clause { + impl #impl_generics #bevy_reflect_path::GetTypeRegistration for #type_name #ty_generics #where_clause { fn get_type_registration() -> #bevy_reflect_path::TypeRegistration { - let mut registration = #bevy_reflect_path::TypeRegistration::of::<#type_name#ty_generics>(); - #(registration.insert::<#registration_data>(#bevy_reflect_path::FromType::<#type_name#ty_generics>::from_type());)* + let mut registration = #bevy_reflect_path::TypeRegistration::of::<#type_name #ty_generics>(); + #(registration.insert::<#registration_data>(#bevy_reflect_path::FromType::<#type_name #ty_generics>::from_type());)* registration } } From 28ec4bfbef8f82053a407e80e36e0c7edc8b9a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Thu, 21 Oct 2021 18:40:12 +0200 Subject: [PATCH 4/6] update for new lint --- crates/bevy_core/src/lib.rs | 2 +- crates/bevy_reflect/bevy_reflect_derive/src/lib.rs | 4 +--- crates/bevy_wgpu/src/lib.rs | 2 +- crates/bevy_window/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index 50ab218cd61f1..e4c6f6de55800 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -43,7 +43,7 @@ impl Plugin for CorePlugin { app.world .get_resource::() .cloned() - .unwrap_or_else(DefaultTaskPoolOptions::default) + .unwrap_or_default() .create_default_pools(&mut app.world); app.init_resource::