@@ -131,13 +131,13 @@ pub fn simplify_not_expr_recursive(
131131 schema : & Schema ,
132132) -> Result < Transformed < Arc < dyn PhysicalExpr > > > {
133133 // First, try to simplify any NOT expressions in this expression
134- let not_simplified = simplify_not_expr ( expr . clone ( ) , schema) ?;
134+ let not_simplified = simplify_not_expr ( Arc :: clone ( & expr ) , schema) ?;
135135
136136 // If the expression was transformed, we might have created new opportunities for simplification
137137 if not_simplified. transformed {
138138 // Recursively simplify the result
139139 let further_simplified =
140- simplify_not_expr_recursive ( not_simplified. data . clone ( ) , schema) ?;
140+ simplify_not_expr_recursive ( Arc :: clone ( & not_simplified. data ) , schema) ?;
141141 if further_simplified. transformed {
142142 return Ok ( Transformed :: yes ( further_simplified. data ) ) ;
143143 } else {
@@ -202,12 +202,12 @@ mod tests {
202202 let schema = test_schema ( ) ;
203203
204204 // Create NOT(NOT(b > 5))
205- let inner_expr = Arc :: new ( BinaryExpr :: new (
205+ let inner_expr: Arc < dyn PhysicalExpr > = Arc :: new ( BinaryExpr :: new (
206206 col ( "b" , & schema) ?,
207207 Operator :: Gt ,
208208 lit ( ScalarValue :: Int32 ( Some ( 5 ) ) ) ,
209209 ) ) ;
210- let inner_not = Arc :: new ( NotExpr :: new ( inner_expr . clone ( ) ) ) ;
210+ let inner_not = Arc :: new ( NotExpr :: new ( Arc :: clone ( & inner_expr ) ) ) ;
211211 let double_not = Arc :: new ( NotExpr :: new ( inner_not) ) ;
212212
213213 let result = simplify_not_expr_recursive ( double_not, & schema) ?;
0 commit comments