Skip to content

Commit e276c8b

Browse files
committed
fix clippy
1 parent 032b19c commit e276c8b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

datafusion/functions/src/core/named_struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl ScalarUDFImpl for NamedStructFunc {
185185
&self,
186186
literal_args: &[Option<ScalarValue>],
187187
) -> Option<StructFieldMapping> {
188-
if literal_args.is_empty() || literal_args.len() % 2 != 0 {
188+
if literal_args.is_empty() || !literal_args.len().is_multiple_of(2) {
189189
return None;
190190
}
191191

datafusion/physical-expr/src/projection.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ impl ProjectionMapping {
641641
None => Ok(Transformed::no(e)),
642642
})
643643
.data()?;
644-
map.entry(source_expr.clone())
644+
map.entry(Arc::clone(&source_expr))
645645
.or_default()
646646
.push((Arc::clone(&target_expr), expr_idx));
647647

@@ -670,7 +670,8 @@ impl ProjectionMapping {
670670
{
671671
if let DataType::Struct(struct_fields) = func_expr.return_type() {
672672
for (accessor_args, source_arg_idx) in &field_mapping.fields {
673-
let value_expr = func_expr.args()[*source_arg_idx].clone();
673+
let value_expr =
674+
Arc::clone(&func_expr.args()[*source_arg_idx]);
674675

675676
// Build accessor args: [target_col, ...field_name_literals]
676677
let mut accessor_fn_args: Vec<Arc<dyn PhysicalExpr>> =

0 commit comments

Comments
 (0)