Make Widget::diff mutable
This commit is contained in:
parent
31bc6d48cd
commit
497ebcd0c3
31 changed files with 114 additions and 81 deletions
|
|
@ -87,8 +87,8 @@ mod loupe {
|
|||
self.content.as_widget().children()
|
||||
}
|
||||
|
||||
fn diff(&self, tree: &mut widget::Tree) {
|
||||
self.content.as_widget().diff(tree);
|
||||
fn diff(&mut self, tree: &mut widget::Tree) {
|
||||
self.content.as_widget_mut().diff(tree);
|
||||
}
|
||||
|
||||
fn size(&self) -> Size<Length> {
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ mod toast {
|
|||
.collect()
|
||||
}
|
||||
|
||||
fn diff(&self, tree: &mut Tree) {
|
||||
fn diff(&mut self, tree: &mut Tree) {
|
||||
let instants = tree.state.downcast_mut::<Vec<Option<Instant>>>();
|
||||
|
||||
// Invalidating removed instants to None allows us to remove
|
||||
|
|
@ -336,8 +336,8 @@ mod toast {
|
|||
}
|
||||
|
||||
tree.diff_children(
|
||||
&std::iter::once(&self.content)
|
||||
.chain(self.toasts.iter())
|
||||
&mut std::iter::once(&mut self.content)
|
||||
.chain(self.toasts.iter_mut())
|
||||
.collect::<Vec<_>>(),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue