@@ -147,7 +147,7 @@ where
147
147
impl SwitchRuleOperator {
148
148
fn apply ( & self , a : & Variant , b : & Variant , c : & Variant , case : bool , _parts : & [ Variant ] ) -> crate :: Result < bool > {
149
149
match self {
150
- Self :: Equal | Self :: Else => Ok ( a == b) ,
150
+ Self :: Equal => Ok ( a == b) ,
151
151
Self :: NotEqual => Ok ( a != b) ,
152
152
Self :: LessThan => Ok ( a < b) ,
153
153
Self :: LessThanEqual => Ok ( a <= b) ,
@@ -199,6 +199,7 @@ impl SwitchRuleOperator {
199
199
( Variant :: Object ( a) , Some ( b) ) => Ok ( a. contains_key ( b) ) ,
200
200
_ => Ok ( false ) ,
201
201
} ,
202
+ Self :: Else => Ok ( * a == Variant :: Bool ( true ) ) ,
202
203
_ => Err ( EdgelinkError :: NotSupported ( "Unsupported operator" . to_owned ( ) ) . into ( ) ) ,
203
204
}
204
205
}
@@ -369,10 +370,7 @@ impl SwitchNode {
369
370
}
370
371
Some ( raw_v2t) => {
371
372
if raw_v2t. is_constant ( ) {
372
- (
373
- Some ( raw_v2t) ,
374
- RedPropertyValue :: evaluate_constant ( & raw_rule. value2 , raw_v2t. try_into ( ) ?) ?,
375
- )
373
+ ( Some ( raw_v2t) , RedPropertyValue :: evaluate_constant ( & raw_rule. value2 , raw_v2t. try_into ( ) ?) ?)
376
374
} else {
377
375
( Some ( raw_v2t) , RedPropertyValue :: Runtime ( raw_rule. value2 . to_string ( ) ?) )
378
376
}
0 commit comments