cargo clippy

This commit is contained in:
collin 2021-03-04 12:08:55 -08:00
parent d400764e00
commit b5fbb9c217
3 changed files with 6 additions and 6 deletions

View File

@ -60,13 +60,13 @@ impl ParserContext {
pub fn peek_oneof(&self, token: &[Token]) -> SyntaxResult<&SpannedToken> {
if let Some(spanned_token) = self.inner.last() {
if token.iter().any(|x| x == &spanned_token.token) {
return Ok(spanned_token);
Ok(spanned_token)
} else {
return Err(SyntaxError::unexpected(
Err(SyntaxError::unexpected(
&spanned_token.token,
token,
&spanned_token.span,
));
))
}
} else {
Err(self.eof())

View File

@ -53,7 +53,7 @@ pub fn parser_pass_tests() {
}
}
}
if fail.len() > 0 {
if !fail.is_empty() {
for (i, fail) in fail.iter().enumerate() {
println!(
"\n\n-----------------TEST #{} FAILED (and shouldn't have)-----------------",
@ -84,7 +84,7 @@ pub fn parser_fail_tests() {
}
}
}
if fail.len() > 0 {
if !fail.is_empty() {
for (i, fail) in fail.iter().enumerate() {
println!(
"\n\n-----------------TEST #{} PASSED (and shouldn't have)-----------------",

View File

@ -79,7 +79,7 @@ impl Token {
}
fn gobble(input: &[u8]) -> (&[u8], Option<Token>) {
if input.len() == 0 {
if input.is_empty() {
return (input, None);
}
match input[0] {