Fix GLSL frontend clippy error

This commit is contained in:
Dzmitry Malyshau
2021-06-18 20:11:42 -04:00
committed by Dzmitry Malyshau
parent bfeab40c8d
commit f0f8a5f3ba
3 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ pub enum ExpectedToken {
IntLiteral,
FloatLiteral,
BoolLiteral,
EOF,
Eof,
}
impl From<TokenValue> for ExpectedToken {
fn from(token: TokenValue) -> Self {
@@ -42,7 +42,7 @@ impl std::fmt::Display for ExpectedToken {
ExpectedToken::IntLiteral => write!(f, "integer literal"),
ExpectedToken::FloatLiteral => write!(f, "float literal"),
ExpectedToken::BoolLiteral => write!(f, "bool literal"),
ExpectedToken::EOF => write!(f, "end of file"),
ExpectedToken::Eof => write!(f, "end of file"),
}
}
}

View File

@@ -427,8 +427,8 @@ impl<'source, 'program, 'options> Parser<'source, 'program, 'options> {
TokenValue::Semicolon if self.program.version == 460 => Ok(()),
_ => {
let expected = match self.program.version {
460 => vec![TokenValue::Semicolon.into(), ExpectedToken::EOF],
_ => vec![ExpectedToken::EOF],
460 => vec![TokenValue::Semicolon.into(), ExpectedToken::Eof],
_ => vec![ExpectedToken::Eof],
};
Err(ErrorKind::InvalidToken(token, expected))
}

View File

@@ -56,7 +56,7 @@ fn version() {
value: TokenValue::Unknown(PreprocessorError::UnexpectedHash),
meta: SourceMetadata { start: 24, end: 25 }
},
vec![ExpectedToken::EOF]
vec![ExpectedToken::Eof]
)
);