mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
fix new clippy lints (#5160)
# Objective - Nightly clippy lints should be fixed before they get stable and break CI ## Solution - fix new clippy lints - ignore `significant_drop_in_scrutinee` since it isn't relevant in our loop https://github.com/rust-lang/rust-clippy/issues/8987 ```rust for line in io::stdin().lines() { ... } ``` Co-authored-by: Jakob Hellermann <hellermann@sipgate.de>
This commit is contained in:
parent
8ba6be187d
commit
49ff42cc69
8 changed files with 20 additions and 22 deletions
|
@ -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 {
|
||||
|
|
|
@ -1230,7 +1230,7 @@ impl<Q: WorldQuery, F: WorldQuery> QueryState<Q, F> {
|
|||
|
||||
/// 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),
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<Shader>,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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>();
|
||||
input.0 = line.unwrap();
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue