@@ -656,17 +656,13 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
656
656
( Value :: Number ( lhs) , Value :: Number ( rhs) ) => {
657
657
Value :: Bool ( compare_numbers ( lhs, rhs, ComparisonOperator :: Equals ) ?)
658
658
}
659
- ( Value :: Bool ( lhs) , Value :: Bool ( rhs) ) => {
660
- Value :: Bool ( lhs == rhs)
661
- }
662
- ( Value :: String ( lhs) , Value :: String ( rhs) ) => {
663
- Value :: Bool ( lhs == rhs)
664
- }
659
+ ( Value :: Bool ( lhs) , Value :: Bool ( rhs) ) => Value :: Bool ( lhs == rhs) ,
660
+ ( Value :: String ( lhs) , Value :: String ( rhs) ) => Value :: Bool ( lhs == rhs) ,
665
661
( Value :: Array ( lhs) , Value :: Array ( rhs) ) => {
666
662
if lhs. len ( ) != rhs. len ( ) {
667
663
Value :: Bool ( false )
668
664
} else {
669
- let are_same = lhs. iter ( ) . zip ( rhs. iter ( ) ) . all ( |( a, b) | a == b) ;
665
+ let are_same = lhs. iter ( ) . zip ( rhs. iter ( ) ) . all ( |( a, b) | a == b) ;
670
666
Value :: Bool ( are_same)
671
667
}
672
668
}
@@ -693,17 +689,13 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
693
689
( Value :: Number ( lhs) , Value :: Number ( rhs) ) => {
694
690
Value :: Bool ( compare_numbers ( lhs, rhs, ComparisonOperator :: NotEquals ) ?)
695
691
}
696
- ( Value :: Bool ( lhs) , Value :: Bool ( rhs) ) => {
697
- Value :: Bool ( lhs != rhs)
698
- }
699
- ( Value :: String ( lhs) , Value :: String ( rhs) ) => {
700
- Value :: Bool ( lhs != rhs)
701
- }
692
+ ( Value :: Bool ( lhs) , Value :: Bool ( rhs) ) => Value :: Bool ( lhs != rhs) ,
693
+ ( Value :: String ( lhs) , Value :: String ( rhs) ) => Value :: Bool ( lhs != rhs) ,
702
694
( Value :: Array ( lhs) , Value :: Array ( rhs) ) => {
703
695
if lhs. len ( ) != rhs. len ( ) {
704
696
Value :: Bool ( true )
705
697
} else {
706
- let are_same = lhs. iter ( ) . zip ( rhs. iter ( ) ) . all ( |( a, b) | a == b) ;
698
+ let are_same = lhs. iter ( ) . zip ( rhs. iter ( ) ) . all ( |( a, b) | a == b) ;
707
699
Value :: Bool ( !are_same)
708
700
}
709
701
}
@@ -815,9 +807,7 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
815
807
output,
816
808
& Rule :: Function ( Function :: Set ( String :: from ( "show" ) , first_rule. clone ( ) ) ) ,
817
809
) ?,
818
- Function :: Do ( first_rule) => {
819
- eval ( input, output, first_rule) ?
820
- }
810
+ Function :: Do ( first_rule) => eval ( input, output, first_rule) ?,
821
811
Function :: Set ( key, rule) => {
822
812
// Output variables can be set any number of times by different rules, except `show`
823
813
// if `show` is at any point set to `false`, we stop executing rules and don't show the ad.
0 commit comments