Revert "Make Widget::diff mutable"

This reverts commit 497ebcd0c3.
This commit is contained in:
Héctor Ramón Jiménez 2025-08-29 04:21:43 +02:00
parent caeb9ce49c
commit 6be707267e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
31 changed files with 83 additions and 121 deletions

View file

@ -125,7 +125,7 @@ where
self.with_element(|element| vec![Tree::new(element.as_widget())])
}
fn diff(&mut self, tree: &mut Tree) {
fn diff(&self, tree: &mut Tree) {
let current = tree
.state
.downcast_mut::<Internal<Message, Theme, Renderer>>();
@ -144,8 +144,8 @@ where
current.element = Rc::new(RefCell::new(Some(element)));
(*self.element.borrow_mut()) = Some(current.element.clone());
self.with_element_mut(|element| {
tree.diff_children(std::slice::from_mut(element));
self.with_element(|element| {
tree.diff_children(std::slice::from_ref(&element.as_widget()));
});
} else {
(*self.element.borrow_mut()) = Some(current.element.clone());