From 2482399239472c8c8436ce09b531dae5cda7d7e4 Mon Sep 17 00:00:00 2001 From: Ellen Date: Sat, 5 Mar 2022 02:43:09 +0000 Subject: [PATCH] how did CI manage to fail on such a PR --- crates/bevy_core_pipeline/src/lib.rs | 6 +++--- crates/bevy_pbr/src/light.rs | 4 ++-- crates/bevy_pbr/src/render/light.rs | 6 ++---- crates/bevy_render/src/view/mod.rs | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/bevy_core_pipeline/src/lib.rs b/crates/bevy_core_pipeline/src/lib.rs index a46bba2789f06..5586d378f69b4 100644 --- a/crates/bevy_core_pipeline/src/lib.rs +++ b/crates/bevy_core_pipeline/src/lib.rs @@ -41,7 +41,7 @@ use bevy_render::{ /// /// This color appears as the "background" color for simple apps, when /// there are portions of the screen with nothing rendered. -#[derive(Clone, Debug)] +#[derive(Copy, Clone, Debug)] pub struct ClearColor(pub Color); impl Default for ClearColor { @@ -355,13 +355,13 @@ pub fn extract_clear_color( // If the clear color has changed if clear_color.is_changed() { // Update the clear color resource in the render world - render_world.insert_resource(clear_color.clone()); + render_world.insert_resource(*clear_color); } // If the clear color has changed if clear_colors.is_changed() { // Update the clear color resource in the render world - render_world.insert_resource(clear_colors.clone()); + render_world.insert_resource((&*clear_colors).clone()); } } diff --git a/crates/bevy_pbr/src/light.rs b/crates/bevy_pbr/src/light.rs index 33781bf774e08..67e87f4b760aa 100644 --- a/crates/bevy_pbr/src/light.rs +++ b/crates/bevy_pbr/src/light.rs @@ -72,7 +72,7 @@ impl PointLight { pub const DEFAULT_SHADOW_NORMAL_BIAS: f32 = 0.6; } -#[derive(Clone, Debug)] +#[derive(Copy, Clone, Debug)] pub struct PointLightShadowMap { pub size: usize, } @@ -150,7 +150,7 @@ impl DirectionalLight { pub const DEFAULT_SHADOW_NORMAL_BIAS: f32 = 0.6; } -#[derive(Clone, Debug)] +#[derive(Copy, Clone, Debug)] pub struct DirectionalLightShadowMap { pub size: usize, } diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index e5d09ea18d7f2..3af318dc83e03 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -343,10 +343,8 @@ pub fn extract_lights( color: ambient_light.color, brightness: ambient_light.brightness, }); - commands.insert_resource::(point_light_shadow_map.clone()); - commands.insert_resource::( - directional_light_shadow_map.clone(), - ); + commands.insert_resource::(*point_light_shadow_map); + commands.insert_resource::(*directional_light_shadow_map); // This is the point light shadow map texel size for one face of the cube as a distance of 1.0 // world unit from the light. // point_light_texel_size = 2.0 * 1.0 * tan(PI / 4.0) / cube face width in texels diff --git a/crates/bevy_render/src/view/mod.rs b/crates/bevy_render/src/view/mod.rs index 95233083c6f6c..a12c55256fda6 100644 --- a/crates/bevy_render/src/view/mod.rs +++ b/crates/bevy_render/src/view/mod.rs @@ -41,7 +41,7 @@ impl Plugin for ViewPlugin { } } -#[derive(Clone)] +#[derive(Copy, Clone)] /// Configuration resource for [Multi-Sample Anti-Aliasing](https://en.wikipedia.org/wiki/Multisample_anti-aliasing). /// /// # Example @@ -72,7 +72,7 @@ impl Default for Msaa { pub fn extract_msaa(mut commands: Commands, msaa: Res) { // NOTE: windows.is_changed() handles cases where a window was resized - commands.insert_resource(msaa.clone()); + commands.insert_resource(*msaa); } #[derive(Component)]