Skip to content

Instantly share code, notes, and snippets.

@Diggsey
Created May 3, 2015 18:45
Show Gist options
  • Save Diggsey/66e162b585cc841602fd to your computer and use it in GitHub Desktop.
Save Diggsey/66e162b585cc841602fd to your computer and use it in GitHub Desktop.
let external = match n.nodes {
[[Node { contents: External(ref mut q @ Some(_)), .. }, Node { contents: External(None), .. }], [Node { contents: External(None), .. }, Node { contents: External(None), .. }]] |
[[Node { contents: External(None), .. }, Node { contents: External(ref mut q @ Some(_)), .. }], [Node { contents: External(None), .. }, Node { contents: External(None), .. }]] |
[[Node { contents: External(None), .. }, Node { contents: External(None), .. }], [Node { contents: External(ref mut q @ Some(_)), .. }, Node { contents: External(None), .. }]] |
[[Node { contents: External(None), .. }, Node { contents: External(None), .. }], [Node { contents: External(None), .. }, Node { contents: External(ref mut q @ Some(_)), .. }]] => {
mem::replace(q, None)
},
_ => None
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment