@@ -147,7 +147,7 @@ where
147147impl SwitchRuleOperator {
148148 fn apply ( & self , a : & Variant , b : & Variant , c : & Variant , case : bool , _parts : & [ Variant ] ) -> crate :: Result < bool > {
149149 match self {
150- Self :: Equal | Self :: Else => Ok ( a == b) ,
150+ Self :: Equal => Ok ( a == b) ,
151151 Self :: NotEqual => Ok ( a != b) ,
152152 Self :: LessThan => Ok ( a < b) ,
153153 Self :: LessThanEqual => Ok ( a <= b) ,
@@ -199,6 +199,7 @@ impl SwitchRuleOperator {
199199 ( Variant :: Object ( a) , Some ( b) ) => Ok ( a. contains_key ( b) ) ,
200200 _ => Ok ( false ) ,
201201 } ,
202+ Self :: Else => Ok ( * a == Variant :: Bool ( true ) ) ,
202203 _ => Err ( EdgelinkError :: NotSupported ( "Unsupported operator" . to_owned ( ) ) . into ( ) ) ,
203204 }
204205 }
@@ -369,10 +370,7 @@ impl SwitchNode {
369370 }
370371 Some ( raw_v2t) => {
371372 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 ( ) ?) ?)
376374 } else {
377375 ( Some ( raw_v2t) , RedPropertyValue :: Runtime ( raw_rule. value2 . to_string ( ) ?) )
378376 }
0 commit comments