mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-28 01:01:53 +03:00
cargo clippy
This commit is contained in:
parent
d400764e00
commit
b5fbb9c217
@ -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())
|
||||
|
@ -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)-----------------",
|
||||
|
@ -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] {
|
||||
|
Loading…
Reference in New Issue
Block a user