Skip to content

Commit

Permalink
Fix tab diff by using is_empty and get_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
genusistimelord committed Feb 29, 2024
1 parent 072bd66 commit 482bce1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/native/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ where
}

fn diff(&self, tree: &mut Tree) {
if !tree.children.contains(1) && !tree.children.contains(1) {
if !tree.children.is_empty() {
let tabs = Tree {
tag: Tag::stateless(),
state: State::None,
Expand All @@ -328,7 +328,7 @@ where
tree.children = vec![bar, tabs];
}

if let Some(tabs) = tree.children.get(1) {
if let Some(tabs) = tree.children.get_mut(1) {
tabs.diff_children(&self.tabs);
}
}
Expand Down

0 comments on commit 482bce1

Please sign in to comment.