Make Widget::diff mutable
This commit is contained in:
parent
31bc6d48cd
commit
497ebcd0c3
31 changed files with 114 additions and 81 deletions
|
|
@ -222,7 +222,7 @@ where
|
|||
self.children.iter().map(Tree::new).collect()
|
||||
}
|
||||
|
||||
fn diff(&self, tree: &mut Tree) {
|
||||
fn diff(&mut self, tree: &mut Tree) {
|
||||
let Tree {
|
||||
state, children, ..
|
||||
} = tree;
|
||||
|
|
@ -231,8 +231,8 @@ where
|
|||
|
||||
tree::diff_children_custom_with_search(
|
||||
children,
|
||||
&self.children,
|
||||
|tree, child| child.as_widget().diff(tree),
|
||||
&mut self.children,
|
||||
|tree, child| child.as_widget_mut().diff(tree),
|
||||
|index| {
|
||||
self.keys.get(index).or_else(|| self.keys.last()).copied()
|
||||
!= Some(state.keys[index])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue