(&mut self, hierarchy: &Value)
| 1594 | } |
| 1595 | |
| 1596 | fn rebuild(&mut self, hierarchy: &Value) { |
| 1597 | self.document_children.clear(); |
| 1598 | self.nodes.clear(); |
| 1599 | self.next_node_id = 2; |
| 1600 | if let Some(roots) = hierarchy.get("roots").and_then(Value::as_array) { |
| 1601 | for root in roots { |
| 1602 | let node_id = self.insert_node(root); |
| 1603 | self.document_children.push(node_id); |
| 1604 | } |
| 1605 | } |
| 1606 | } |
| 1607 | |
| 1608 | fn insert_node(&mut self, node: &Value) -> u64 { |
| 1609 | let node_id = self.next_node_id; |
no test coverage detected