From d3f5a985baddc2a16ea3eb2dca1d4788584f239d Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:35:49 -0800 Subject: [PATCH] Misc --- src/apply_mutations.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/apply_mutations.rs b/src/apply_mutations.rs index bf6d709..5fdf2b4 100644 --- a/src/apply_mutations.rs +++ b/src/apply_mutations.rs @@ -64,7 +64,9 @@ pub fn apply_mutations( value .as_any() .downcast_ref::>() - .expect("Attribute value does not impl Reflect"), + .expect(&format!( + "Encountered an attribute with name {name} that did not impl Reflect" + )), )), BorrowedAttributeValue::None => None, _ => unreachable!("Should not be used by bevy_dioxus elements"), @@ -96,7 +98,7 @@ impl Command for SetReflectedComponent { let reflected_component = type_registry .get_with_type_path(&self.component_type_path) .expect(&format!( - "Encountered an attribute with name {} that was not registered", + "Encountered an attribute with name {} that was not registered for reflection", self.component_type_path )) .data::() @@ -107,7 +109,7 @@ impl Command for SetReflectedComponent { let entity_mut = &mut world.entity_mut(self.entity); match self.component_value { - Some(value) => reflected_component.apply_or_insert(entity_mut, &*value), + Some(value) => reflected_component.insert(entity_mut, &*value), None => reflected_component.remove(entity_mut), } });