diff options
author | Greg Brown <gmb60@cam.ac.uk> | 2021-01-21 09:42:02 +0000 |
---|---|---|
committer | Greg Brown <gmb60@cam.ac.uk> | 2021-01-21 17:45:02 +0000 |
commit | 1a93b1f82bc8c21d24e67031c5eca96830e928c7 (patch) | |
tree | 4c3fbfac9f0fbbc31defee03cd460e0400278d30 /src/chomp/ast/substitute.rs | |
parent | faa3f30deb32d0a1fd7cb196559762635b22ecfd (diff) |
Fix many warnings.
Diffstat (limited to 'src/chomp/ast/substitute.rs')
-rw-r--r-- | src/chomp/ast/substitute.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/chomp/ast/substitute.rs b/src/chomp/ast/substitute.rs index 1a622e1..c7cc03f 100644 --- a/src/chomp/ast/substitute.rs +++ b/src/chomp/ast/substitute.rs @@ -418,13 +418,7 @@ impl Folder for InlineCalls { expr: call.into(), span, }) - } else if call.args.len() != self.function.params.len() { - Err(SubstituteError::WrongArgCount { - call, - expected: self.function.params.len(), - span, - }) - } else { + } else if call.args.len() == self.function.params.len() { let mut expr = self .function .expr @@ -434,6 +428,12 @@ impl Folder for InlineCalls { expr.span = expr.span.or(span); Ok(expr) + } else { + Err(SubstituteError::WrongArgCount { + call, + expected: self.function.params.len(), + span, + }) } } } |