refactor: remove many unwrap calls

This commit is contained in:
Nova
2023-01-25 11:50:53 -05:00
parent b5e87d5911
commit 529b86fa91
26 changed files with 163 additions and 133 deletions

View File

@@ -133,8 +133,12 @@ impl Node {
node.add_local_signal("destroy", Node::destroy_flex);
node
}
pub fn add_to_scenegraph(self) -> Arc<Node> {
self.get_client().unwrap().scenegraph.add_node(self)
pub fn add_to_scenegraph(self) -> Result<Arc<Node>> {
Ok(self
.get_client()
.ok_or_else(|| eyre!("Internal: Unable to get client"))?
.scenegraph
.add_node(self))
}
pub fn destroy(&self) {
if let Some(client) = self.get_client() {