From 6091fa9d9c5fc78a6c6d0e082ab3618346a330b8 Mon Sep 17 00:00:00 2001 From: Weijun Huang Date: Wed, 29 Nov 2023 14:10:33 +0100 Subject: [PATCH] clean up the code based on Clippy --- datafusion/optimizer/src/optimize_projections.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datafusion/optimizer/src/optimize_projections.rs b/datafusion/optimizer/src/optimize_projections.rs index 1e98ee76d2d9..b6d026279aa6 100644 --- a/datafusion/optimizer/src/optimize_projections.rs +++ b/datafusion/optimizer/src/optimize_projections.rs @@ -381,7 +381,7 @@ fn merge_consecutive_projections(proj: &Projection) -> Result .flat_map(|expr| expr.to_columns()) .fold(HashMap::new(), |mut map, cols| { cols.into_iter() - .for_each(|col| *map.entry(col.clone()).or_default() += 1); + .for_each(|col| *map.entry(col).or_default() += 1); map }); @@ -827,7 +827,7 @@ fn rewrite_projection_given_requirements( if &projection_schema(&input, &exprs_used)? == input.schema() { Ok(Some(input)) } else { - let new_proj = Projection::try_new(exprs_used, Arc::new(input.clone()))?; + let new_proj = Projection::try_new(exprs_used, Arc::new(input))?; let new_proj = LogicalPlan::Projection(new_proj); Ok(Some(new_proj)) }