@@ -61,10 +61,10 @@ impl SimplExpr {
61
61
pub fn map_terminals_into ( self , f : impl Fn ( Self ) -> Self ) -> Self {
62
62
use SimplExpr :: * ;
63
63
match self {
64
- BinOp ( span, box a, op, box b) => BinOp ( span, box f( a) , op, box f( b) ) ,
65
- UnaryOp ( span, op, box a) => UnaryOp ( span, op, box f( a) ) ,
66
- IfElse ( span, box a, box b, box c) => IfElse ( span, box f( a) , box f( b) , box f( c) ) ,
67
- JsonAccess ( span, box a, box b) => JsonAccess ( span, box f( a) , box f( b) ) ,
64
+ BinOp ( span, box a, op, box b) => BinOp ( span, Box :: new ( f ( a) ) , op, Box :: new ( f ( b) ) ) ,
65
+ UnaryOp ( span, op, box a) => UnaryOp ( span, op, Box :: new ( f ( a) ) ) ,
66
+ IfElse ( span, box a, box b, box c) => IfElse ( span, Box :: new ( f ( a) ) , Box :: new ( f ( b) ) , Box :: new ( f ( c) ) ) ,
67
+ JsonAccess ( span, box a, box b) => JsonAccess ( span, Box :: new ( f ( a) ) , Box :: new ( f ( b) ) ) ,
68
68
FunctionCall ( span, name, args) => FunctionCall ( span, name, args. into_iter ( ) . map ( f) . collect ( ) ) ,
69
69
other => f ( other) ,
70
70
}
@@ -76,13 +76,13 @@ impl SimplExpr {
76
76
match self {
77
77
// Literal(x) => Ok(Literal(AttrValue::from_primitive(x.resolve_fully(&variables)?))),
78
78
Literal ( span, x) => Ok ( Literal ( span, x) ) ,
79
- BinOp ( span, box a, op, box b) => Ok ( BinOp ( span, box a. resolve_refs ( variables) ?, op, box b. resolve_refs ( variables) ?) ) ,
80
- UnaryOp ( span, op, box x) => Ok ( UnaryOp ( span, op, box x. resolve_refs ( variables) ?) ) ,
79
+ BinOp ( span, box a, op, box b) => Ok ( BinOp ( span, Box :: new ( a. resolve_refs ( variables) ?) , op, Box :: new ( b. resolve_refs ( variables) ?) ) ) ,
80
+ UnaryOp ( span, op, box x) => Ok ( UnaryOp ( span, op, Box :: new ( x. resolve_refs ( variables) ?) ) ) ,
81
81
IfElse ( span, box a, box b, box c) => {
82
- Ok ( IfElse ( span, box a. resolve_refs ( variables) ?, box b. resolve_refs ( variables) ?, box c. resolve_refs ( variables) ?) )
82
+ Ok ( IfElse ( span, Box :: new ( a. resolve_refs ( variables) ?) , Box :: new ( b. resolve_refs ( variables) ?) , Box :: new ( c. resolve_refs ( variables) ?) ) )
83
83
}
84
84
JsonAccess ( span, box a, box b) => {
85
- Ok ( JsonAccess ( span, box a. resolve_refs ( variables) ?, box b. resolve_refs ( variables) ?) )
85
+ Ok ( JsonAccess ( span, Box :: new ( a. resolve_refs ( variables) ?) , Box :: new ( b. resolve_refs ( variables) ?) ) )
86
86
}
87
87
FunctionCall ( span, function_name, args) => Ok ( FunctionCall (
88
88
span,
0 commit comments