Browse Source

make clippy happy

Evan Almloff 1 year ago
parent
commit
9d044ee589
2 changed files with 4 additions and 5 deletions
  1. 3 3
      packages/core/src/create.rs
  2. 1 2
      packages/core/src/diff.rs

+ 3 - 3
packages/core/src/create.rs

@@ -188,7 +188,7 @@ impl<'b> VirtualDom {
             node @ Component { .. } | node @ Fragment(_) => {
                 let template_ref = ElementRef {
                     path: ElementPath {
-                        path: &template.template.get().node_paths[idx],
+                        path: template.template.get().node_paths[idx],
                     },
                     template: template.stable_id().unwrap(),
                     scope: self.runtime.current_scope_id().unwrap_or(ScopeId(0)),
@@ -198,7 +198,7 @@ impl<'b> VirtualDom {
             Placeholder(VPlaceholder { id, parent }) => {
                 let template_ref = ElementRef {
                     path: ElementPath {
-                        path: &template.template.get().node_paths[idx],
+                        path: template.template.get().node_paths[idx],
                     },
                     template: template.stable_id().unwrap(),
                     scope: self.runtime.current_scope_id().unwrap_or(ScopeId(0)),
@@ -287,7 +287,7 @@ impl<'b> VirtualDom {
         for idx in reversed_iter {
             let boundary_ref = ElementRef {
                 path: ElementPath {
-                    path: &template.template.get().node_paths[idx],
+                    path: template.template.get().node_paths[idx],
                 },
                 template: template.stable_id().unwrap(),
                 scope: self.runtime.current_scope_id().unwrap_or(ScopeId(0)),

+ 1 - 2
packages/core/src/diff.rs

@@ -619,8 +619,7 @@ impl<'b> VirtualDom {
         }
 
         // 4. Compute the LIS of this list
-        let mut lis_sequence = Vec::default();
-        lis_sequence.reserve(new_index_to_old_index.len());
+        let mut lis_sequence = Vec::with_capacity(new_index_to_old_index.len());
 
         let mut predecessors = vec![0; new_index_to_old_index.len()];
         let mut starts = vec![0; new_index_to_old_index.len()];