[parser] Flatten the matches

This commit is contained in:
Eryn Wells 2018-08-24 07:54:00 -07:00
parent 2f9c16ff38
commit d9abd033e7

View file

@ -44,15 +44,12 @@ impl<T> Iterator for Parser<T> where T: Iterator<Item=LexerResult> {
type Item = Result; type Item = Result;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
let mut lex = self.input.next(); let mut result: Option<NodeParseResult> = None;
loop { loop {
match lex { match self.input.next() {
Some(ref lex) => { Some(Ok(ref lex)) => {
match lex { },
Ok(ref lex) => { Some(Err(ref error)) => {
}
Err(error) => {}
}
}, },
None => break None => break
} }