Added get_name() fn
@@ -47,12 +47,7 @@ impl<'a> WidgetContainer<'a> {
return property;
}
- let name = self
- .ecm
- .component_store()
- .get::<String>("name", self.current_node)
- .unwrap()
- .clone();
+ let name = self.get_name();
panic!(
"Widget with name: {} and entity: {} does not contain property width type_id {:?} for key: {}",
@@ -114,12 +109,7 @@ impl<'a> WidgetContainer<'a> {
return property.clone();
}
- let name = self
- .ecm
- .component_store()
- .get::<String>("name", self.current_node)
- .unwrap()
- .clone();
+ let name = self.get_name();
panic!(
"Widget with name: {} and entity: {} does not contain property width type_id {:?} for key: {}",
@@ -161,12 +151,7 @@ impl<'a> WidgetContainer<'a> {
return;
}
- let name = self
- .ecm
- .component_store()
- .get::<String>("name", self.current_node)
- .unwrap()
- .clone();
+ let name = self.get_name();
panic!(
"Widget with name: {} and entity: {} does not contain property width type_id {:?} for key: {}",
@@ -437,4 +422,13 @@ impl<'a> WidgetContainer<'a> {
}
}
}
+
+ fn get_name(&self) -> String {
+ self
+ .ecm
+ .component_store()
+ .get::<String>("name", self.current_node)
+ .unwrap()
+ .clone()
+ }
}
