@@ -6,7 +6,6 @@ use crate::error::{LexicalError, LexicalErrorType};
66type ParameterDefs = ( Vec < ast:: Parameter > , Vec < ast:: Expression > ) ;
77type ParameterDef = ( ast:: Parameter , Option < ast:: Expression > ) ;
88
9- #[ allow( clippy:: collapsible_if) ]
109pub fn parse_params (
1110 params : ( Vec < ParameterDef > , Vec < ParameterDef > ) ,
1211) -> Result < ParameterDefs , LexicalError > {
@@ -16,15 +15,13 @@ pub fn parse_params(
1615 let mut try_default = |name : & ast:: Parameter , default| {
1716 if let Some ( default) = default {
1817 defaults. push ( default) ;
19- } else {
20- if !defaults. is_empty ( ) {
21- // Once we have started with defaults, all remaining arguments must
22- // have defaults
23- return Err ( LexicalError {
24- error : LexicalErrorType :: DefaultArgumentError ,
25- location : name. location ,
26- } ) ;
27- }
18+ } else if !defaults. is_empty ( ) {
19+ // Once we have started with defaults, all remaining arguments must
20+ // have defaults
21+ return Err ( LexicalError {
22+ error : LexicalErrorType :: DefaultArgumentError ,
23+ location : name. location ,
24+ } ) ;
2825 }
2926 Ok ( ( ) )
3027 } ;
0 commit comments