Skip to content

Instantly share code, notes, and snippets.

@MaikKlein
Created December 12, 2017 20:31
Show Gist options
  • Select an option

  • Save MaikKlein/7bc6b6909c06cdaad88b9f3948ce4aa2 to your computer and use it in GitHub Desktop.

Select an option

Save MaikKlein/7bc6b6909c06cdaad88b9f3948ce4aa2 to your computer and use it in GitHub Desktop.
let node = *edges_iter.next().unwrap();
for neighbor in edges_iter {
g.add_edge(node, *neighbor, 1);
}
if let Some(node) = edges_iter.next() {
for neighbor in edges_iter {
g.add_edge(node, *neighbor, 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment