Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Nov 7, 2024
1 parent 51ad918 commit fcf7617
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/widget/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,16 @@ impl Tree {
HashMap<String, &mut Tree>,
VecDeque<(usize, &mut Tree)>,
) = self.children.iter_mut().enumerate().fold(
(HashMap::new(), Vec::with_capacity(children_len)),
(HashMap::new(), VecDeque::with_capacity(children_len)),
|(mut id_map, mut id_list), (i, c)| {
if let Some(id) = c.id.as_ref() {
if let Internal::Custom(_, ref name) = id.0 {
let _ = id_map.insert(name.to_string(), c);
} else {
id_list.push((i, c));
id_list.push_back((i, c));
}
} else {
id_list.push((i, c));
id_list.push_back((i, c));
}
(id_map, id_list)
},
Expand Down

0 comments on commit fcf7617

Please sign in to comment.