From f1fc0e5c99a947da95b69dd36e7dfeed4a7bbde2 Mon Sep 17 00:00:00 2001 From: LW/ZG Date: Sun, 3 Sep 2023 14:40:07 -0400 Subject: [PATCH] applied rustfmt changes --- bevy_script_api/src/common/bevy/mod.rs | 20 ++++++++++++-------- bevy_script_api/src/sub_reflect.rs | 12 ++++++------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/bevy_script_api/src/common/bevy/mod.rs b/bevy_script_api/src/common/bevy/mod.rs index d2c288b5..7528784c 100644 --- a/bevy_script_api/src/common/bevy/mod.rs +++ b/bevy_script_api/src/common/bevy/mod.rs @@ -169,8 +169,9 @@ impl ScriptWorld { ) -> Result { let mut w = self.write(); - let mut entity_ref = w.get_entity_mut(entity).ok_or_else(|| { - ScriptError::Other(format!("Entity is not valid {:#?}", entity))})?; + let mut entity_ref = w + .get_entity_mut(entity) + .ok_or_else(|| ScriptError::Other(format!("Entity is not valid {:#?}", entity)))?; let component_data = comp_type.data::().ok_or_else(|| { ScriptError::Other(format!("Not a component {}", comp_type.short_name())) @@ -208,8 +209,9 @@ impl ScriptWorld { ) -> Result, ScriptError> { let w = self.read(); - let entity_ref = w.get_entity(entity).ok_or_else(|| { - ScriptError::Other(format!("Entity is not valid {:#?}", entity))})?; + let entity_ref = w + .get_entity(entity) + .ok_or_else(|| ScriptError::Other(format!("Entity is not valid {:#?}", entity)))?; let component_data = comp_type.data::().ok_or_else(|| { ScriptError::Other(format!("Not a component {}", comp_type.short_name())) @@ -230,8 +232,9 @@ impl ScriptWorld { ScriptError::Other(format!("Not a component {}", comp_type.short_name())) })?; - let entity_ref = w.get_entity(entity).ok_or_else(|| { - ScriptError::Other(format!("Entity is not valid {:#?}", entity))})?; + let entity_ref = w + .get_entity(entity) + .ok_or_else(|| ScriptError::Other(format!("Entity is not valid {:#?}", entity)))?; Ok(component_data.reflect(entity_ref).is_some()) } @@ -243,8 +246,9 @@ impl ScriptWorld { ) -> Result<(), ScriptError> { let mut w = self.write(); - let mut entity_ref = w.get_entity_mut(entity).ok_or_else(|| { - ScriptError::Other(format!("Entity is not valid {:#?}", entity))})?; + let mut entity_ref = w + .get_entity_mut(entity) + .ok_or_else(|| ScriptError::Other(format!("Entity is not valid {:#?}", entity)))?; let component_data = comp_type.data::().ok_or_else(|| { ScriptError::Other(format!("Not a component {}", comp_type.short_name())) diff --git a/bevy_script_api/src/sub_reflect.rs b/bevy_script_api/src/sub_reflect.rs index 9f7002a1..7eb125a9 100644 --- a/bevy_script_api/src/sub_reflect.rs +++ b/bevy_script_api/src/sub_reflect.rs @@ -348,12 +348,12 @@ impl ReflectPath { ReflectBase::Component { comp, entity } => { let g = world_ptr.read(); - let entity_ref = g.get_entity(*entity).ok_or_else(|| { - ReflectionError::InvalidBaseReference { - base: self.base.to_string(), - reason: "This entity does not exist".to_owned(), - }})?; - + let entity_ref = + g.get_entity(*entity) + .ok_or_else(|| ReflectionError::InvalidBaseReference { + base: self.base.to_string(), + reason: "This entity does not exist".to_owned(), + })?; let ref_ = self.walk_path(comp.reflect(entity_ref).ok_or_else(|| { ReflectionError::InvalidBaseReference {