Skip to content

Commit

Permalink
fixup! fixup! Enable needless_pass_by_value clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Aug 29, 2024
1 parent 485101a commit 6528d96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion datafusion/core/tests/user_defined/user_defined_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ impl UserDefinedLogicalNodeCore for TopKPlanNode {
Ok(Self {
k: self.k,
input: inputs.swap_remove(0),
expr: replace_sort_expression(self.expr.clone(), exprs.swap_remove(0)),
expr: replace_sort_expression(&self.expr, exprs.swap_remove(0)),
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions datafusion/expr/src/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ pub fn replace_sort_expressions(sorts: Vec<Sort>, new_expr: Vec<Expr>) -> Vec<So
sorts
.into_iter()
.zip(new_expr)
.map(|(sort, expr)| replace_sort_expression(sort, expr))
.map(|(sort, expr)| replace_sort_expression(&sort, expr))
.collect()
}

pub fn replace_sort_expression(sort: Sort, new_expr: Expr) -> Sort {
pub fn replace_sort_expression(sort: &Sort, new_expr: Expr) -> Sort {
Sort {
expr: Box::new(new_expr),
..sort
..*sort
}
}

0 comments on commit 6528d96

Please sign in to comment.