@@ -143,7 +143,7 @@ impl VNode {
143143 & self ,
144144 root_idx : usize ,
145145 ) -> Option < ( usize , & DynamicNode ) > {
146- self . template . roots [ root_idx]
146+ self . template . roots ( ) [ root_idx]
147147 . dynamic_id ( )
148148 . map ( |id| ( id, & self . dynamic_nodes [ id] ) )
149149 }
@@ -180,7 +180,7 @@ impl VNode {
180180
181181 pub ( crate ) fn find_last_element ( & self , dom : & VirtualDom ) -> ElementId {
182182 let mount_id = self . mount . get ( ) ;
183- let last_root_index = self . template . roots . len ( ) - 1 ;
183+ let last_root_index = self . template . roots ( ) . len ( ) - 1 ;
184184 let last = match self . get_dynamic_root_node_and_id ( last_root_index) {
185185 // This node is static, just get the root id
186186 None => dom. get_mounted_root_node ( mount_id, last_root_index) ,
@@ -306,7 +306,7 @@ impl VNode {
306306 destroy_component_state : bool ,
307307 replace_with : Option < usize > ,
308308 ) {
309- let roots = self . template . roots ;
309+ let roots = self . template . roots ( ) ;
310310 for ( idx, node) in roots. iter ( ) . enumerate ( ) {
311311 let last_node = idx == roots. len ( ) - 1 ;
312312 if let Some ( id) = node. dynamic_id ( ) {
@@ -343,7 +343,7 @@ impl VNode {
343343 ) {
344344 let template = self . template ;
345345 for ( idx, dyn_node) in self . dynamic_nodes . iter ( ) . enumerate ( ) {
346- let path_len = template. node_paths . get ( idx) . map ( |path| path. len ( ) ) ;
346+ let path_len = template. node_paths ( ) . get ( idx) . map ( |path| path. len ( ) ) ;
347347 // Roots are cleaned up automatically above and nodes with a empty path are placeholders
348348 if let Some ( 2 ..) = path_len {
349349 self . remove_dynamic_node (
@@ -398,7 +398,7 @@ impl VNode {
398398
399399 pub ( super ) fn reclaim_attributes ( & self , mount : MountId , dom : & mut VirtualDom ) {
400400 let mut next_id = None ;
401- for ( idx, path) in self . template . attr_paths . iter ( ) . enumerate ( ) {
401+ for ( idx, path) in self . template . attr_paths ( ) . iter ( ) . enumerate ( ) {
402402 // We clean up the roots in the next step, so don't worry about them here
403403 if path. len ( ) <= 1 {
404404 continue ;
@@ -429,7 +429,7 @@ impl VNode {
429429 let mut old_attributes_iter = old_attrs. iter ( ) . peekable ( ) ;
430430 let mut new_attributes_iter = new_attrs. iter ( ) . peekable ( ) ;
431431 let attribute_id = dom. get_mounted_dyn_attr ( mount_id, idx) ;
432- let path = self . template . attr_paths [ idx] ;
432+ let path = self . template . attr_paths ( ) [ idx] ;
433433
434434 loop {
435435 match ( old_attributes_iter. peek ( ) , new_attributes_iter. peek ( ) ) {
@@ -558,18 +558,18 @@ impl VNode {
558558 entry. insert ( VNodeMount {
559559 node : self . clone ( ) ,
560560 parent,
561- root_ids : vec ! [ ElementId ( 0 ) ; template. roots. len( ) ] . into_boxed_slice ( ) ,
562- mounted_attributes : vec ! [ ElementId ( 0 ) ; template. attr_paths. len( ) ]
561+ root_ids : vec ! [ ElementId ( 0 ) ; template. roots( ) . len( ) ] . into_boxed_slice ( ) ,
562+ mounted_attributes : vec ! [ ElementId ( 0 ) ; template. attr_paths( ) . len( ) ]
563563 . into_boxed_slice ( ) ,
564- mounted_dynamic_nodes : vec ! [ usize :: MAX ; template. node_paths. len( ) ]
564+ mounted_dynamic_nodes : vec ! [ usize :: MAX ; template. node_paths( ) . len( ) ]
565565 . into_boxed_slice ( ) ,
566566 } ) ;
567567 }
568568
569569 // Walk the roots, creating nodes and assigning IDs
570570 // nodes in an iterator of (dynamic_node_index, path) and attrs in an iterator of (attr_index, path)
571- let mut nodes = template. node_paths . iter ( ) . copied ( ) . enumerate ( ) . peekable ( ) ;
572- let mut attrs = template. attr_paths . iter ( ) . copied ( ) . enumerate ( ) . peekable ( ) ;
571+ let mut nodes = template. node_paths ( ) . iter ( ) . copied ( ) . enumerate ( ) . peekable ( ) ;
572+ let mut attrs = template. attr_paths ( ) . iter ( ) . copied ( ) . enumerate ( ) . peekable ( ) ;
573573
574574 // Get the mounted id of this block
575575 // At this point, we should have already mounted the block
@@ -588,7 +588,7 @@ impl VNode {
588588 // Go through each root node and create the node, adding it to the stack.
589589 // Each node already exists in the template, so we can just clone it from the template
590590 let nodes_created = template
591- . roots
591+ . roots ( )
592592 . iter ( )
593593 . enumerate ( )
594594 . map ( |( root_idx, root) | {
@@ -646,7 +646,7 @@ impl VNode {
646646 fn reference_to_dynamic_node ( & self , mount : MountId , dynamic_node_id : usize ) -> ElementRef {
647647 ElementRef {
648648 path : ElementPath {
649- path : self . template . node_paths [ dynamic_node_id] ,
649+ path : self . template . node_paths ( ) [ dynamic_node_id] ,
650650 } ,
651651 mount,
652652 }
@@ -772,7 +772,7 @@ impl VNode {
772772 // If we actually created real new nodes, we need to replace the placeholder for this dynamic node with the new dynamic nodes
773773 if m > 0 {
774774 // The path is one shorter because the top node is the root
775- let path = & self . template . node_paths [ dynamic_node_id] [ 1 ..] ;
775+ let path = & self . template . node_paths ( ) [ dynamic_node_id] [ 1 ..] ;
776776 to. replace_placeholder_with_nodes ( path, m) ;
777777 }
778778 }
0 commit comments