diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 385f4a18e..0b41f4916 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -993,7 +993,7 @@ impl VirtualDom { .expect("VComponents to always have a scope"); // Remove the component from the dom - match unsafe { self.get_scope(scope).unwrap().root_node() } { + match self.get_scope(scope).unwrap().root_node() { RenderReturn::Ready(t) => self.remove_node(t, gen_muts, to), RenderReturn::Aborted(placeholder) => { self.remove_placeholder(placeholder, gen_muts, to) @@ -1012,7 +1012,7 @@ impl VirtualDom { Some(Placeholder(t)) => t.id.get().unwrap(), Some(Component(comp)) => { let scope = comp.scope.get().unwrap(); - match unsafe { self.get_scope(scope).unwrap().root_node() } { + match self.get_scope(scope).unwrap().root_node() { RenderReturn::Ready(t) => self.find_first_element(t), _ => todo!("cannot handle nonstandard nodes"), } @@ -1028,7 +1028,7 @@ impl VirtualDom { Some(Placeholder(t)) => t.id.get().unwrap(), Some(Component(comp)) => { let scope = comp.scope.get().unwrap(); - match unsafe { self.get_scope(scope).unwrap().root_node() } { + match self.get_scope(scope).unwrap().root_node() { RenderReturn::Ready(t) => self.find_last_element(t), _ => todo!("cannot handle nonstandard nodes"), } diff --git a/packages/core/src/scope_arena.rs b/packages/core/src/scope_arena.rs index a1d5d8b89..20cba5480 100644 --- a/packages/core/src/scope_arena.rs +++ b/packages/core/src/scope_arena.rs @@ -34,7 +34,7 @@ impl VirtualDom { pub(crate) fn run_scope(&mut self, scope_id: ScopeId) -> RenderReturn { self.runtime.scope_stack.borrow_mut().push(scope_id); - let new_nodes = unsafe { + let new_nodes = { let scope = &self.scopes[scope_id.0]; let context = scope.context(); diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 1e567fae3..b4209e7aa 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -549,7 +549,7 @@ impl VirtualDom { match unsafe { self.run_scope(ScopeId::ROOT) } { // Rebuilding implies we append the created elements to the root RenderReturn::Ready(node) => { - let m = self.create_scope(ScopeId::ROOT, &node); + let m = self.create_scope(ScopeId::ROOT, &node, to); to.append_children(ElementId(0), m); } // If an error occurs, we should try to render the default error component and context where the error occured