[reader] Replace == None with .is_none() in Parser::token

This replaces a full function call with matching on both lhs and rhs
with a single cmpb instruction.
This commit is contained in:
bjorn3
2020-08-26 12:36:30 +02:00
committed by Andrew Brown
parent 0d3f9ad8ef
commit 0c4e15a52e

View File

@@ -445,7 +445,7 @@ impl<'a> Parser<'a> {
// running. I don't think this is true - self.lookahead is mutated in the loop body - so // running. I don't think this is true - self.lookahead is mutated in the loop body - so
// maybe this is a clippy bug? Either way, disable clippy for this. // maybe this is a clippy bug? Either way, disable clippy for this.
#[cfg_attr(feature = "cargo-clippy", allow(clippy::while_immutable_condition))] #[cfg_attr(feature = "cargo-clippy", allow(clippy::while_immutable_condition))]
while self.lookahead == None { while self.lookahead.is_none() {
match self.lex.next() { match self.lex.next() {
Some(Ok(LocatedToken { token, location })) => { Some(Ok(LocatedToken { token, location })) => {
match token { match token {