diff --git a/crates/bevy_ecs/src/query/par_iter.rs b/crates/bevy_ecs/src/query/par_iter.rs index 1d18b69ca0..27bc201783 100644 --- a/crates/bevy_ecs/src/query/par_iter.rs +++ b/crates/bevy_ecs/src/query/par_iter.rs @@ -78,6 +78,12 @@ impl BatchingStrategy { } } +impl Default for BatchingStrategy { + fn default() -> Self { + Self::new() + } +} + /// A parallel iterator over query results of a [`Query`](crate::system::Query). /// /// This struct is created by the [`Query::par_iter`](crate::system::Query::par_iter) and diff --git a/crates/bevy_ecs/src/schedule/stepping.rs b/crates/bevy_ecs/src/schedule/stepping.rs index a129993e89..f516faaa20 100644 --- a/crates/bevy_ecs/src/schedule/stepping.rs +++ b/crates/bevy_ecs/src/schedule/stepping.rs @@ -696,7 +696,7 @@ impl ScheduleState { // if our NodeId list hasn't been populated, copy it over from the // schedule if self.node_ids.len() != schedule.systems_len() { - self.node_ids = schedule.executable().system_ids.clone(); + self.node_ids.clone_from(&schedule.executable().system_ids); } // Now that we have the schedule, apply any pending system behavior diff --git a/crates/bevy_hierarchy/src/child_builder.rs b/crates/bevy_hierarchy/src/child_builder.rs index 9f36fe679e..6c32979666 100644 --- a/crates/bevy_hierarchy/src/child_builder.rs +++ b/crates/bevy_hierarchy/src/child_builder.rs @@ -481,7 +481,7 @@ pub struct WorldChildBuilder<'w> { impl<'w> WorldChildBuilder<'w> { /// Spawns an entity with the given bundle and inserts it into the parent entity's [`Children`]. /// Also adds [`Parent`] component to the created entity. - pub fn spawn(&mut self, bundle: impl Bundle + Send + Sync + 'static) -> EntityWorldMut<'_> { + pub fn spawn(&mut self, bundle: impl Bundle) -> EntityWorldMut<'_> { let entity = self.world.spawn((bundle, Parent(self.parent))).id(); push_child_unchecked(self.world, self.parent, entity); push_events( diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index f81db9d6c7..c97ad5fc54 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -1059,7 +1059,7 @@ impl Reflect for Cow<'static, str> { fn apply(&mut self, value: &dyn Reflect) { let value = value.as_any(); if let Some(value) = value.downcast_ref::() { - *self = value.clone(); + self.clone_from(value); } else { panic!("Value is not a {}.", Self::type_path()); } @@ -1548,7 +1548,7 @@ impl Reflect for Cow<'static, Path> { fn apply(&mut self, value: &dyn Reflect) { let value = value.as_any(); if let Some(value) = value.downcast_ref::() { - *self = value.clone(); + self.clone_from(value); } else { panic!("Value is not a {}.", Self::type_path()); } diff --git a/crates/bevy_reflect/src/utility.rs b/crates/bevy_reflect/src/utility.rs index 2c026441ed..df860d194c 100644 --- a/crates/bevy_reflect/src/utility.rs +++ b/crates/bevy_reflect/src/utility.rs @@ -110,6 +110,12 @@ impl NonGenericTypeCell { } } +impl Default for NonGenericTypeCell { + fn default() -> Self { + Self::new() + } +} + /// A container for [`TypedProperty`] over generic types, allowing instances to be stored statically. /// /// This is specifically meant for use with generic types. If your type isn't generic, @@ -245,6 +251,12 @@ impl GenericTypeCell { } } +impl Default for GenericTypeCell { + fn default() -> Self { + Self::new() + } +} + /// Deterministic fixed state hasher to be used by implementors of [`Reflect::reflect_hash`]. /// /// Hashes should be deterministic across processes so hashes can be used as diff --git a/crates/bevy_render/src/extract_component.rs b/crates/bevy_render/src/extract_component.rs index a19f93539b..4b327cf6af 100644 --- a/crates/bevy_render/src/extract_component.rs +++ b/crates/bevy_render/src/extract_component.rs @@ -123,14 +123,14 @@ impl Default for ComponentUniforms { /// This system prepares all components of the corresponding component type. /// They are transformed into uniforms and stored in the [`ComponentUniforms`] resource. -fn prepare_uniform_components( +fn prepare_uniform_components( mut commands: Commands, render_device: Res, render_queue: Res, mut component_uniforms: ResMut>, components: Query<(Entity, &C)>, ) where - C: ShaderType + WriteInto + Clone, + C: Component + ShaderType + WriteInto + Clone, { let components_iter = components.iter(); let count = components_iter.len();