Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Aug 18, 2024
1 parent 340d03a commit c491767
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 22 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_animation/src/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -106,7 +106,7 @@ impl AnimationTransitions {
}

/// Iterator over animations currently being transitioned out
pub fn get_transitions(&self) -> impl Iterator<Item=&AnimationTransition> {
pub fn get_transitions(&self) -> impl Iterator<Item = &AnimationTransition> {
self.transitions.iter()
}
}
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_pbr/src/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,9 +949,7 @@ impl<M: Material> RenderAsset for PreparedMaterial<M> {
Err(AsBindGroupError::RetryNextUpdate) => {
Err(PrepareAssetError::RetryNextUpdate(material))
}
Err(AsBindGroupError::InvalidData(msg)) => {
Err(PrepareAssetError::InvalidData(msg))
}
Err(AsBindGroupError::InvalidData(msg)) => Err(PrepareAssetError::InvalidData(msg)),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_render/macros/src/as_bind_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
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,
)
));
};
Expand All @@ -394,8 +394,8 @@ pub fn derive_as_bind_group(ast: syn::DeriveInput) -> Result<TokenStream> {
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
)
));
Expand Down
15 changes: 12 additions & 3 deletions crates/bevy_render/src/render_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -352,7 +355,10 @@ pub fn prepare_assets<A: RenderAsset>(
prepare_next_frame.assets.push((id, extracted_asset));
}
Err(PrepareAssetError::InvalidData(msg)) => {
warn!("Material2d<{}> Bind group contains invalid data: {msg}", std::any::type_name::<A>());
warn!(
"Material2d<{}> Bind group contains invalid data: {msg}",
std::any::type_name::<A>()
);
}
}
}
Expand Down Expand Up @@ -387,7 +393,10 @@ pub fn prepare_assets<A: RenderAsset>(
prepare_next_frame.assets.push((id, extracted_asset));
}
Err(PrepareAssetError::InvalidData(msg)) => {
warn!("Material2d<{}> Bind group contains invalid data: {msg}", std::any::type_name::<A>());
warn!(
"Material2d<{}> Bind group contains invalid data: {msg}",
std::any::type_name::<A>()
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_resource/bind_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand Down
6 changes: 5 additions & 1 deletion crates/bevy_render/src/texture/image_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_sprite/src/mesh2d/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,7 @@ impl<M: Material2d> RenderAsset for PreparedMaterial2d<M> {
Err(AsBindGroupError::RetryNextUpdate) => {
Err(PrepareAssetError::RetryNextUpdate(material))
}
Err(AsBindGroupError::InvalidData(msg)) => {
Err(PrepareAssetError::InvalidData(msg))
}
Err(AsBindGroupError::InvalidData(msg)) => Err(PrepareAssetError::InvalidData(msg)),
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion crates/bevy_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_ui/src/render/ui_material_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,7 @@ impl<M: UiMaterial> RenderAsset for PreparedUiMaterial<M> {
Err(AsBindGroupError::RetryNextUpdate) => {
Err(PrepareAssetError::RetryNextUpdate(material))
}
Err(AsBindGroupError::InvalidData(msg)) => {
Err(PrepareAssetError::InvalidData(msg))
}
Err(AsBindGroupError::InvalidData(msg)) => Err(PrepareAssetError::InvalidData(msg)),
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_ui/src/ui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c491767

Please sign in to comment.