Skip to content

Commit a0bc946

Browse files
committed
Fixed formatting
1 parent 2649284 commit a0bc946

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

primitives/src/targeting/eval.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -656,17 +656,13 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
656656
(Value::Number(lhs), Value::Number(rhs)) => {
657657
Value::Bool(compare_numbers(lhs, rhs, ComparisonOperator::Equals)?)
658658
}
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),
665661
(Value::Array(lhs), Value::Array(rhs)) => {
666662
if lhs.len() != rhs.len() {
667663
Value::Bool(false)
668664
} 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);
670666
Value::Bool(are_same)
671667
}
672668
}
@@ -693,17 +689,13 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
693689
(Value::Number(lhs), Value::Number(rhs)) => {
694690
Value::Bool(compare_numbers(lhs, rhs, ComparisonOperator::NotEquals)?)
695691
}
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),
702694
(Value::Array(lhs), Value::Array(rhs)) => {
703695
if lhs.len() != rhs.len() {
704696
Value::Bool(true)
705697
} 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);
707699
Value::Bool(!are_same)
708700
}
709701
}
@@ -815,9 +807,7 @@ fn eval(input: &Input, output: &mut Output, rule: &Rule) -> Result<Option<Value>
815807
output,
816808
&Rule::Function(Function::Set(String::from("show"), first_rule.clone())),
817809
)?,
818-
Function::Do(first_rule) => {
819-
eval(input, output, first_rule)?
820-
}
810+
Function::Do(first_rule) => eval(input, output, first_rule)?,
821811
Function::Set(key, rule) => {
822812
// Output variables can be set any number of times by different rules, except `show`
823813
// if `show` is at any point set to `false`, we stop executing rules and don't show the ad.

0 commit comments

Comments
 (0)