Skip to content

Instantly share code, notes, and snippets.

Created June 13, 2016 15:37
Show Gist options
  • Save anonymous/bdb8e4b640efe1704bf118a058e02df9 to your computer and use it in GitHub Desktop.
Save anonymous/bdb8e4b640efe1704bf118a058e02df9 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
let expect_next_token = |it: &mut Iter<u8>, tok: u8| -> bool {
match it.peekable().peek() {
Some(x) => {
if **x == tok {
return true;
}
}
None => {
return false;
}
}
return false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment