Skip to content

Commit

Permalink
Fix property diffing to account for various node states
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Apr 7, 2021
1 parent 8f58d16 commit 1b9a563
Show file tree
Hide file tree
Showing 4 changed files with 419 additions and 249 deletions.
6 changes: 6 additions & 0 deletions azul-core/src/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,15 @@ impl_vec_eq!(CallbackData, CallbackDataVec);
impl_vec_hash!(CallbackData, CallbackDataVec);

impl CallbackDataVec {
#[inline]
pub fn as_container<'a>(&'a self) -> NodeDataContainerRef<'a, CallbackData> {
NodeDataContainerRef { internal: self.as_ref() }
}
#[inline]
pub fn as_container_mut<'a>(&'a mut self) -> NodeDataContainerRefMut<'a, CallbackData> {
NodeDataContainerRefMut { internal: self.as_mut() }
}
#[inline]
pub(crate) fn into_library_owned_vec(&mut self) -> Vec<CallbackData> {
let mut vec = Vec::with_capacity(self.as_ref().len());
for item in self.as_mut().iter_mut() {
Expand Down Expand Up @@ -686,12 +689,15 @@ impl_vec_eq!(NodeData, NodeDataVec);
impl_vec_hash!(NodeData, NodeDataVec);

impl NodeDataVec {
#[inline]
pub fn as_container<'a>(&'a self) -> NodeDataContainerRef<'a, NodeData> {
NodeDataContainerRef { internal: self.as_ref() }
}
#[inline]
pub fn as_container_mut<'a>(&'a mut self) -> NodeDataContainerRefMut<'a, NodeData> {
NodeDataContainerRefMut { internal: self.as_mut() }
}
#[inline]
pub fn into_library_owned_vec(&mut self) -> Vec<NodeData> {
let mut vec = Vec::with_capacity(self.as_ref().len());
for item in self.as_mut().iter_mut() {
Expand Down
Loading

0 comments on commit 1b9a563

Please sign in to comment.