diff --git a/src/zkas/analyzer.rs b/src/zkas/analyzer.rs index 95665c0a4..973fbe64a 100644 --- a/src/zkas/analyzer.rs +++ b/src/zkas/analyzer.rs @@ -270,18 +270,16 @@ impl Analyzer { v.column, )) } - } else if arg_types[0] == VarType::ScalarArray { - if var_type != VarType::Scalar { - return Err(self.error.abort( - &format!( - "Incorrect argument type. Expected `{:?}`, got `{:?}`.", - VarType::Scalar, - var_type - ), - v.line, - v.column, - )) - } + } else if arg_types[0] == VarType::ScalarArray && var_type != VarType::Scalar { + return Err(self.error.abort( + &format!( + "Incorrect argument type. Expected `{:?}`, got `{:?}`.", + VarType::Scalar, + var_type + ), + v.line, + v.column, + )) } // Validation for non-Array types if var_type != arg_types[idx] { diff --git a/src/zkas/parser.rs b/src/zkas/parser.rs index 512bd3fa6..12eaa21ac 100644 --- a/src/zkas/parser.rs +++ b/src/zkas/parser.rs @@ -124,7 +124,7 @@ impl Parser { let mut ast_inner = IndexMap::new(); let mut ast = IndexMap::new(); - if self.tokens.len() == 0 { + if self.tokens.is_empty() { return Err(self.error.abort("Source file does not contain any valid tokens.", 0, 0)) } @@ -1056,7 +1056,7 @@ impl Parser { // x => unimplemented!("{:#?}", x), _ => { return Err(self.error.abort( - &format!("Characer is illegal/unimplemented in this context",), + "Character is illegal/unimplemented in this context", arg.line, arg.column, ))