From c491767b9a9617cd878f2e7c03ba539291e484e9 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Sun, 18 Aug 2024 18:57:40 +0100 Subject: [PATCH] ci --- crates/bevy_animation/src/transition.rs | 4 ++-- crates/bevy_pbr/src/material.rs | 4 +--- crates/bevy_render/macros/src/as_bind_group.rs | 8 ++++---- crates/bevy_render/src/render_asset.rs | 15 ++++++++++++--- .../bevy_render/src/render_resource/bind_group.rs | 2 +- crates/bevy_render/src/texture/image_loader.rs | 6 +++++- crates/bevy_sprite/src/mesh2d/material.rs | 4 +--- crates/bevy_ui/src/lib.rs | 4 +++- crates/bevy_ui/src/render/ui_material_pipeline.rs | 4 +--- crates/bevy_ui/src/ui_node.rs | 5 ++++- 10 files changed, 34 insertions(+), 22 deletions(-) diff --git a/crates/bevy_animation/src/transition.rs b/crates/bevy_animation/src/transition.rs index ac74346bebbca..014c9322d7c01 100644 --- a/crates/bevy_animation/src/transition.rs +++ b/crates/bevy_animation/src/transition.rs @@ -96,7 +96,7 @@ impl AnimationTransitions { // Otherwise the transition ending would incorrectly stop the new animation. self.transitions .retain(|transition| transition.animation != new_animation); - + player.start(new_animation) } @@ -106,7 +106,7 @@ impl AnimationTransitions { } /// Iterator over animations currently being transitioned out - pub fn get_transitions(&self) -> impl Iterator { + pub fn get_transitions(&self) -> impl Iterator { self.transitions.iter() } } diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index 755457c87e480..0443eaf63d749 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -949,9 +949,7 @@ impl RenderAsset for PreparedMaterial { Err(AsBindGroupError::RetryNextUpdate) => { Err(PrepareAssetError::RetryNextUpdate(material)) } - Err(AsBindGroupError::InvalidData(msg)) => { - Err(PrepareAssetError::InvalidData(msg)) - } + Err(AsBindGroupError::InvalidData(msg)) => Err(PrepareAssetError::InvalidData(msg)), } } } diff --git a/crates/bevy_render/macros/src/as_bind_group.rs b/crates/bevy_render/macros/src/as_bind_group.rs index a03da9f80b891..a614b2f166fb3 100644 --- a/crates/bevy_render/macros/src/as_bind_group.rs +++ b/crates/bevy_render/macros/src/as_bind_group.rs @@ -382,8 +382,8 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { return Err(#render_path::render_resource::AsBindGroupError::InvalidData( format!( "binding index {}: no sampler for format `{:?}`", - #binding_index, - image.texture_format, + #binding_index, + image.texture_format, ) )); }; @@ -394,8 +394,8 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result { return Err(#render_path::render_resource::AsBindGroupError::InvalidData( format!( "binding index {}: image sampler type `{:?}` must be one of `{:?}`", - #binding_index, - sample_type, + #binding_index, + sample_type, #expected_samplers ) )); diff --git a/crates/bevy_render/src/render_asset.rs b/crates/bevy_render/src/render_asset.rs index 460ff32dde1e9..f3b1d44a1221d 100644 --- a/crates/bevy_render/src/render_asset.rs +++ b/crates/bevy_render/src/render_asset.rs @@ -9,7 +9,10 @@ use bevy_ecs::{ }; use bevy_reflect::{Reflect, ReflectDeserialize, ReflectSerialize}; use bevy_render_macros::ExtractResource; -use bevy_utils::{tracing::{debug, warn}, HashMap, HashSet}; +use bevy_utils::{ + tracing::{debug, warn}, + HashMap, HashSet, +}; use serde::{Deserialize, Serialize}; use std::marker::PhantomData; use thiserror::Error; @@ -352,7 +355,10 @@ pub fn prepare_assets( prepare_next_frame.assets.push((id, extracted_asset)); } Err(PrepareAssetError::InvalidData(msg)) => { - warn!("Material2d<{}> Bind group contains invalid data: {msg}", std::any::type_name::()); + warn!( + "Material2d<{}> Bind group contains invalid data: {msg}", + std::any::type_name::() + ); } } } @@ -387,7 +393,10 @@ pub fn prepare_assets( prepare_next_frame.assets.push((id, extracted_asset)); } Err(PrepareAssetError::InvalidData(msg)) => { - warn!("Material2d<{}> Bind group contains invalid data: {msg}", std::any::type_name::()); + warn!( + "Material2d<{}> Bind group contains invalid data: {msg}", + std::any::type_name::() + ); } } } diff --git a/crates/bevy_render/src/render_resource/bind_group.rs b/crates/bevy_render/src/render_resource/bind_group.rs index 6bec407b0ae37..2a11f029ea993 100644 --- a/crates/bevy_render/src/render_resource/bind_group.rs +++ b/crates/bevy_render/src/render_resource/bind_group.rs @@ -353,7 +353,7 @@ pub enum AsBindGroupError { #[error("The bind group could not be generated")] RetryNextUpdate, #[error("The bindgroup data is invalid: {0}")] - InvalidData(String), + InvalidData(String), } /// A prepared bind group returned as a result of [`AsBindGroup::as_bind_group`]. diff --git a/crates/bevy_render/src/texture/image_loader.rs b/crates/bevy_render/src/texture/image_loader.rs index fecf4f5da409a..5355faa78c1a4 100644 --- a/crates/bevy_render/src/texture/image_loader.rs +++ b/crates/bevy_render/src/texture/image_loader.rs @@ -100,7 +100,11 @@ impl AssetLoader for ImageLoader { let image_type = match settings.format { ImageFormatSetting::FromExtension => { // use the file extension for the image type - let ext = load_context.path().extension().and_then(OsStr::to_str).unwrap_or("image"); + let ext = load_context + .path() + .extension() + .and_then(OsStr::to_str) + .unwrap_or("image"); ImageType::Extension(ext) } ImageFormatSetting::Format(format) => ImageType::Format(format), diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index 846baf79dc0bb..a3c480271414e 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -508,9 +508,7 @@ impl RenderAsset for PreparedMaterial2d { Err(AsBindGroupError::RetryNextUpdate) => { Err(PrepareAssetError::RetryNextUpdate(material)) } - Err(AsBindGroupError::InvalidData(msg)) => { - Err(PrepareAssetError::InvalidData(msg)) - } + Err(AsBindGroupError::InvalidData(msg)) => Err(PrepareAssetError::InvalidData(msg)), } } } diff --git a/crates/bevy_ui/src/lib.rs b/crates/bevy_ui/src/lib.rs index 40fad88462acb..d6c0b89303f6d 100644 --- a/crates/bevy_ui/src/lib.rs +++ b/crates/bevy_ui/src/lib.rs @@ -54,7 +54,9 @@ use bevy_app::prelude::*; use bevy_ecs::prelude::*; use bevy_input::InputSystem; use bevy_render::{ - camera::CameraUpdateSystem, view::{check_visibility, VisibilitySystems}, RenderApp + camera::CameraUpdateSystem, + view::{check_visibility, VisibilitySystems}, + RenderApp, }; use bevy_transform::TransformSystem; use layout::ui_surface::UiSurface; diff --git a/crates/bevy_ui/src/render/ui_material_pipeline.rs b/crates/bevy_ui/src/render/ui_material_pipeline.rs index 286051fe817b9..6c2d7c9124190 100644 --- a/crates/bevy_ui/src/render/ui_material_pipeline.rs +++ b/crates/bevy_ui/src/render/ui_material_pipeline.rs @@ -624,9 +624,7 @@ impl RenderAsset for PreparedUiMaterial { Err(AsBindGroupError::RetryNextUpdate) => { Err(PrepareAssetError::RetryNextUpdate(material)) } - Err(AsBindGroupError::InvalidData(msg)) => { - Err(PrepareAssetError::InvalidData(msg)) - } + Err(AsBindGroupError::InvalidData(msg)) => Err(PrepareAssetError::InvalidData(msg)), } } } diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index b4d27c253fd00..fb1b058a8b1b2 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -79,7 +79,10 @@ impl Node { /// Returns the logical pixel coordinates of the UI node, based on its [`GlobalTransform`]. #[inline] pub fn logical_rect(&self, transform: &GlobalTransform) -> Rect { - Rect::from_center_size(transform.translation().truncate(), self.size().max(Vec2::ZERO)) + Rect::from_center_size( + transform.translation().truncate(), + self.size().max(Vec2::ZERO), + ) } /// Returns the physical pixel coordinates of the UI node, based on its [`GlobalTransform`] and the scale factor.