clippy fix

This commit is contained in:
Evan Almloff 2024-01-09 11:02:07 -06:00
parent 41abffb267
commit 967c082085
3 changed files with 6 additions and 6 deletions

View file

@ -116,7 +116,7 @@ impl VirtualDom {
//
// `shared_prefix_count` is the count of how many nodes at the start of
// `new` and `old` share the same keys.
let (left_offset, right_offset) = match self.diff_keyed_ends(to, old, new, parent.clone()) {
let (left_offset, right_offset) = match self.diff_keyed_ends(to, old, new, parent) {
Some(count) => count,
None => return,
};
@ -340,7 +340,7 @@ impl VirtualDom {
let new_idx = idx + last + 1;
let old_index = new_index_to_old_index[new_idx];
if old_index == u32::MAX as usize {
nodes_created += new_node.create(self, to, parent.clone());
nodes_created += new_node.create(self, to, parent);
} else {
old[old_index].diff_node(new_node, self, to);
nodes_created += new_node.push_all_real_nodes(self, to);
@ -363,7 +363,7 @@ impl VirtualDom {
let new_idx = idx + next + 1;
let old_index = new_index_to_old_index[new_idx];
if old_index == u32::MAX as usize {
nodes_created += new_node.create(self, to, parent.clone());
nodes_created += new_node.create(self, to, parent);
} else {
old[old_index].diff_node(new_node, self, to);
nodes_created += new_node.push_all_real_nodes(self, to);
@ -386,7 +386,7 @@ impl VirtualDom {
for (idx, new_node) in new[..first_lis].iter().enumerate() {
let old_index = new_index_to_old_index[idx];
if old_index == u32::MAX as usize {
nodes_created += new_node.create(self, to, parent.clone());
nodes_created += new_node.create(self, to, parent);
} else {
old[old_index].diff_node(new_node, self, to);
nodes_created += new_node.push_all_real_nodes(self, to);

View file

@ -22,7 +22,7 @@ impl VirtualDom {
) -> usize {
nodes
.into_iter()
.map(|child| child.create(self, to, parent.clone()))
.map(|child| child.create(self, to, parent))
.sum()
}

View file

@ -369,7 +369,7 @@ impl VirtualDom {
| <-- no, broke early
*/
let parent_path = match self.elements.get(element.0) {
Some(Some(el)) => el.clone(),
Some(Some(el)) => *el,
_ => return,
};
let mut parent_node = Some(parent_path);