refactor: remove many unwrap calls
This commit is contained in:
@@ -17,11 +17,11 @@ pub struct Root {
|
||||
logic_step: AtomicBool,
|
||||
}
|
||||
impl Root {
|
||||
pub fn create(client: &Arc<Client>) -> Arc<Self> {
|
||||
pub fn create(client: &Arc<Client>) -> Result<Arc<Self>> {
|
||||
let node = Node::create(client, "", "", false);
|
||||
node.add_local_signal("subscribe_logic_step", Root::subscribe_logic_step);
|
||||
node.add_local_signal("set_base_prefixes", Root::set_base_prefixes);
|
||||
let node = node.add_to_scenegraph();
|
||||
let node = node.add_to_scenegraph()?;
|
||||
let _ = Spatial::add_to(
|
||||
&node,
|
||||
None,
|
||||
@@ -33,10 +33,10 @@ impl Root {
|
||||
false,
|
||||
);
|
||||
|
||||
ROOT_REGISTRY.add(Root {
|
||||
Ok(ROOT_REGISTRY.add(Root {
|
||||
node,
|
||||
logic_step: AtomicBool::from(false),
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
fn subscribe_logic_step(_node: &Node, calling_client: Arc<Client>, _data: &[u8]) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user