Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.32 KB | None | 0 0
  1. fn append_children(node : &mut Node, nodes : &HashMap<&str, Vec<&str>>) {
  2.     if let Some(n_arr) = nodes.get(node.name) {
  3.         for n in n_arr {
  4.             node.children.push(Node { name : n, children : Vec::new() });
  5.             append_children(&mut node.children[node.children.len()-1], nodes);
  6.         }
  7.     }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement