This is an automated email from the ASF dual-hosted git repository.

dheres pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 6cfdd59b2f Remove some clones (#16404)
6cfdd59b2f is described below

commit 6cfdd59b2f7d5df6ba0ddacf9505b5a7e8a14f39
Author: Simon Vandel Sillesen <simon.van...@gmail.com>
AuthorDate: Sat Jun 14 21:54:45 2025 +0200

    Remove some clones (#16404)
---
 datafusion/expr/src/logical_plan/tree_node.rs                  |  8 ++++----
 .../optimizer/src/simplify_expressions/inlist_simplifier.rs    | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/datafusion/expr/src/logical_plan/tree_node.rs 
b/datafusion/expr/src/logical_plan/tree_node.rs
index 2a290e692a..7f5b7e07ed 100644
--- a/datafusion/expr/src/logical_plan/tree_node.rs
+++ b/datafusion/expr/src/logical_plan/tree_node.rs
@@ -436,11 +436,11 @@ impl LogicalPlan {
                 filters.apply_elements(f)
             }
             LogicalPlan::Unnest(unnest) => {
-                let columns = unnest.exec_columns.clone();
-
-                let exprs = columns
+                let exprs = unnest
+                    .exec_columns
                     .iter()
-                    .map(|c| Expr::Column(c.clone()))
+                    .cloned()
+                    .map(Expr::Column)
                     .collect::<Vec<_>>();
                 exprs.apply_elements(f)
             }
diff --git a/datafusion/optimizer/src/simplify_expressions/inlist_simplifier.rs 
b/datafusion/optimizer/src/simplify_expressions/inlist_simplifier.rs
index c8638eb723..a1c1dc17d2 100644
--- a/datafusion/optimizer/src/simplify_expressions/inlist_simplifier.rs
+++ b/datafusion/optimizer/src/simplify_expressions/inlist_simplifier.rs
@@ -39,10 +39,10 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
         // if expr is a single column reference:
         // expr IN (A, B, ...) --> (expr = A) OR (expr = B) OR (expr = C)
         if let Expr::InList(InList {
-            expr,
-            list,
+            ref expr,
+            ref list,
             negated,
-        }) = expr.clone()
+        }) = expr
         {
             if !list.is_empty()
                 && (
@@ -57,7 +57,7 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
             {
                 let first_val = list[0].clone();
                 if negated {
-                    return Ok(Transformed::yes(list.into_iter().skip(1).fold(
+                    return 
Ok(Transformed::yes(list.iter().skip(1).cloned().fold(
                         (*expr.clone()).not_eq(first_val),
                         |acc, y| {
                             // Note that `A and B and C and D` is a left-deep 
tree structure
@@ -81,7 +81,7 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
                         },
                     )));
                 } else {
-                    return Ok(Transformed::yes(list.into_iter().skip(1).fold(
+                    return 
Ok(Transformed::yes(list.iter().skip(1).cloned().fold(
                         (*expr.clone()).eq(first_val),
                         |acc, y| {
                             // Same reasoning as above


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@datafusion.apache.org
For additional commands, e-mail: commits-h...@datafusion.apache.org

Reply via email to