From a8f6a659eabf3603391eaeabb9c611389ed08654 Mon Sep 17 00:00:00 2001 From: Benjamin Brienen Date: Sun, 29 Dec 2024 14:28:59 -0500 Subject: [PATCH] Fix random clippy warning (#17010) # Objective Follow-up to #16984 ## Solution Fix the lint ## Testing ``` PS C:\Users\BenjaminBrienen\source\bevy> cargo clippy Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.71s PS C:\Users\BenjaminBrienen\source\bevy> cargo clippy -p bevy_ecs Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.21s ``` --- crates/bevy_ecs/Cargo.toml | 4 ++-- crates/bevy_ecs/src/entity/clone_entities.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml index add6ff18615f7..e32b51a916637 100644 --- a/crates/bevy_ecs/Cargo.toml +++ b/crates/bevy_ecs/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/bevyengine/bevy" license = "MIT OR Apache-2.0" keywords = ["ecs", "game", "bevy"] categories = ["game-engines", "data-structures"] -rust-version = "1.81.0" +rust-version = "1.82.0" [features] default = ["std", "bevy_reflect", "async_executor"] @@ -84,7 +84,7 @@ critical-section = [ ] ## `portable-atomic` provides additional platform support for atomic types and -## operations, even on targets without native support. +## operations, even on targets without native support. portable-atomic = [ "dep:portable-atomic", "dep:portable-atomic-util", diff --git a/crates/bevy_ecs/src/entity/clone_entities.rs b/crates/bevy_ecs/src/entity/clone_entities.rs index b15723aa57419..4a326cc955d75 100644 --- a/crates/bevy_ecs/src/entity/clone_entities.rs +++ b/crates/bevy_ecs/src/entity/clone_entities.rs @@ -147,10 +147,10 @@ impl<'a, 'b> ComponentCloneCtx<'a, 'b> { if self.target_component_written { panic!("Trying to write component '{short_name}' multiple times") } - if !self + if self .component_info .type_id() - .is_some_and(|id| id == TypeId::of::()) + .is_none_or(|id| id != TypeId::of::()) { panic!("TypeId of component '{short_name}' does not match source component TypeId") };