diff --git a/crates/bevy_ecs/macros/src/fetch.rs b/crates/bevy_ecs/macros/src/fetch.rs index 5d21a93f64..2bbb08cc98 100644 --- a/crates/bevy_ecs/macros/src/fetch.rs +++ b/crates/bevy_ecs/macros/src/fetch.rs @@ -361,7 +361,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream { } }; - let tokens = TokenStream::from(quote! { + TokenStream::from(quote! { #fetch_impl #state_impl @@ -421,8 +421,7 @@ pub fn derive_world_query_impl(ast: DeriveInput) -> TokenStream { #(q.#ignored_field_idents;)* } }; - }); - tokens + }) } struct WorldQueryFieldInfo { diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs index cc769886b3..beb4776e1d 100644 --- a/crates/bevy_ecs/src/query/state.rs +++ b/crates/bevy_ecs/src/query/state.rs @@ -1230,7 +1230,7 @@ impl QueryState { /// An error that occurs when retrieving a specific [`Entity`]'s query result. // TODO: return the type_name as part of this error -#[derive(Debug, PartialEq, Clone, Copy)] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum QueryEntityError { QueryDoesNotMatch(Entity), NoSuchEntity(Entity), diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index f18e2dcc7e..c6cd534567 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -1027,8 +1027,7 @@ async fn load_buffers( Err(()) => { // TODO: Remove this and add dep let buffer_path = asset_path.parent().unwrap().join(uri); - let buffer_bytes = load_context.read_asset_bytes(buffer_path).await?; - buffer_bytes + load_context.read_asset_bytes(buffer_path).await? } }; buffer_data.push(buffer_bytes); diff --git a/crates/bevy_render/src/render_resource/pipeline.rs b/crates/bevy_render/src/render_resource/pipeline.rs index 04e2c772d0..c5bee4a56b 100644 --- a/crates/bevy_render/src/render_resource/pipeline.rs +++ b/crates/bevy_render/src/render_resource/pipeline.rs @@ -157,7 +157,7 @@ impl VertexBufferLayout { } /// Describes the fragment process in a render pipeline. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct FragmentState { /// The compiled shader module for this stage. pub shader: Handle, diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index e21abb8d3e..fe37109555 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -139,7 +139,7 @@ impl Default for Style { } /// How items are aligned according to the cross axis -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum AlignItems { /// Items are aligned at the start @@ -156,7 +156,7 @@ pub enum AlignItems { } /// Works like [`AlignItems`] but applies only to a single item -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum AlignSelf { /// Use the value of [`AlignItems`] @@ -177,7 +177,7 @@ pub enum AlignSelf { /// Defines how each line is aligned within the flexbox. /// /// It only applies if [`FlexWrap::Wrap`] is present and if there are multiple lines of items. -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum AlignContent { /// Each line moves towards the start of the cross axis @@ -200,7 +200,7 @@ pub enum AlignContent { /// Defines the text direction /// /// For example English is written LTR (left-to-right) while Arabic is written RTL (right-to-left). -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum Direction { /// Inherit from parent node @@ -213,7 +213,7 @@ pub enum Direction { } /// Whether to use Flexbox layout -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum Display { /// Use flexbox @@ -224,7 +224,7 @@ pub enum Display { } /// Defines how flexbox items are ordered within a flexbox -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum FlexDirection { /// Same way as text direction along the main axis @@ -239,7 +239,7 @@ pub enum FlexDirection { } /// Defines how items are aligned according to the main axis -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum JustifyContent { /// Pushed towards the start @@ -258,7 +258,7 @@ pub enum JustifyContent { } /// Whether to show or hide overflowing items -#[derive(Copy, Clone, PartialEq, Debug, Default, Reflect, Serialize, Deserialize)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Reflect, Serialize, Deserialize)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum Overflow { /// Show overflowing items @@ -269,7 +269,7 @@ pub enum Overflow { } /// The strategy used to position this node -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum PositionType { /// Relative to all other nodes with the [`PositionType::Relative`] value @@ -282,7 +282,7 @@ pub enum PositionType { } /// Defines if flexbox items appear on a single line or on multiple lines -#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] +#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum FlexWrap { /// Single line, will overflow if needed diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs index 6557d414c5..ae7cf9b7ae 100644 --- a/crates/bevy_window/src/window.rs +++ b/crates/bevy_window/src/window.rs @@ -267,7 +267,7 @@ pub enum WindowCommand { } /// Defines the way a window is displayed. -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum WindowMode { /// Creates a window that uses the given size. Windowed, diff --git a/examples/app/custom_loop.rs b/examples/app/custom_loop.rs index f9f1e607e2..8e6d655cd8 100644 --- a/examples/app/custom_loop.rs +++ b/examples/app/custom_loop.rs @@ -2,13 +2,13 @@ //! lines from stdin and prints them from within the ecs. use bevy::prelude::*; -use std::{io, io::BufRead}; +use std::io; struct Input(String); fn my_runner(mut app: App) { println!("Type stuff into the console"); - for line in io::stdin().lock().lines() { + for line in io::stdin().lines() { { let mut input = app.world.resource_mut::(); input.0 = line.unwrap(); diff --git a/examples/reflection/reflection_types.rs b/examples/reflection/reflection_types.rs index d6e7227699..e5600066e3 100644 --- a/examples/reflection/reflection_types.rs +++ b/examples/reflection/reflection_types.rs @@ -36,7 +36,7 @@ pub struct C(usize); /// These are exposed via methods like `Reflect::hash()`, `Reflect::partial_eq()`, and /// `Reflect::serialize()`. You can force these implementations to use the actual trait /// implementations (instead of their defaults) like this: -#[derive(Reflect, Hash, Serialize, PartialEq)] +#[derive(Reflect, Hash, Serialize, PartialEq, Eq)] #[reflect(Hash, Serialize, PartialEq)] pub struct D { x: usize, @@ -47,7 +47,7 @@ pub struct D { /// generally a good idea to implement (and reflect) the `PartialEq`, `Serialize`, and `Deserialize` /// traits on `reflect_value` types to ensure that these values behave as expected when nested /// underneath Reflect-ed structs. -#[derive(Reflect, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Reflect, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[reflect_value(PartialEq, Serialize, Deserialize)] pub enum E { X,