@@ -400,15 +400,14 @@ impl ParameterConstraint {
400400 TypeParamDefsItemType :: DataType => Self :: DataType ,
401401 TypeParamDefsItemType :: Boolean => Self :: Boolean ,
402402 TypeParamDefsItemType :: Integer => {
403- if let Some ( min_f) = min
404- && min_f. fract ( ) != 0.0
405- {
406- return Err ( TypeParamError :: InvalidIntegerBounds { min, max } ) ;
407- }
408- if let Some ( max_f) = max
409- && max_f. fract ( ) != 0.0
410- {
411- return Err ( TypeParamError :: InvalidIntegerBounds { min, max } ) ;
403+ match ( min, max) {
404+ ( Some ( min_f) , _) if min_f. fract ( ) != 0.0 => {
405+ return Err ( TypeParamError :: InvalidIntegerBounds { min, max } ) ;
406+ }
407+ ( _, Some ( max_f) ) if max_f. fract ( ) != 0.0 => {
408+ return Err ( TypeParamError :: InvalidIntegerBounds { min, max } ) ;
409+ }
410+ _ => ( ) ,
412411 }
413412
414413 let min_i = min. map ( |v| v as i64 ) ;
@@ -1016,15 +1015,15 @@ fn expect_integer_param(
10161015 } ) ,
10171016 } ?;
10181017
1019- if let Some ( range) = & range
1020- && !range. contains ( & value)
1021- {
1022- return Err ( ExtensionTypeError :: InvalidParameterRange {
1023- type_name : type_name . to_string ( ) ,
1024- index ,
1025- value : i64 :: from ( value ) ,
1026- expected : range . clone ( ) ,
1027- } ) ;
1018+ if let Some ( range) = & range {
1019+ if !range. contains ( & value) {
1020+ return Err ( ExtensionTypeError :: InvalidParameterRange {
1021+ type_name : type_name . to_string ( ) ,
1022+ index ,
1023+ value : i64 :: from ( value ) ,
1024+ expected : range . clone ( ) ,
1025+ } ) ;
1026+ }
10281027 }
10291028
10301029 Ok ( value)
0 commit comments