Skip to content

Commit e10862f

Browse files
committed
Fix clippy lints
1 parent 1c065d1 commit e10862f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

datafusion/catalog/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl From<&dyn Session> for TaskContext {
145145
state.scalar_functions().clone(),
146146
state.aggregate_functions().clone(),
147147
state.window_functions().clone(),
148-
state.runtime_env().clone(),
148+
Arc::clone(state.runtime_env()),
149149
)
150150
}
151151
}

datafusion/functions-table/src/generate_series.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ impl LazyBatchGenerator for GenerateSeriesState {
114114
return Ok(None);
115115
}
116116

117-
let batch = RecordBatch::try_new(self.schema.clone(), vec![Arc::new(array)])?;
117+
let batch =
118+
RecordBatch::try_new(Arc::clone(&self.schema), vec![Arc::new(array)])?;
118119

119120
Ok(Some(batch))
120121
}
@@ -127,7 +128,7 @@ impl TableProvider for GenerateSeriesTable {
127128
}
128129

129130
fn schema(&self) -> SchemaRef {
130-
self.schema.clone()
131+
Arc::clone(&self.schema)
131132
}
132133

133134
fn table_type(&self) -> TableType {
@@ -146,7 +147,7 @@ impl TableProvider for GenerateSeriesTable {
146147
let state = match self.args {
147148
// if args have null, then return 0 row
148149
GenSeriesArgs::ContainsNull { include_end, name } => GenerateSeriesState {
149-
schema: self.schema.clone(),
150+
schema: self.schema(),
150151
start: 0,
151152
end: 0,
152153
step: 1,
@@ -162,7 +163,7 @@ impl TableProvider for GenerateSeriesTable {
162163
include_end,
163164
name,
164165
} => GenerateSeriesState {
165-
schema: self.schema.clone(),
166+
schema: self.schema(),
166167
start,
167168
end,
168169
step,
@@ -174,7 +175,7 @@ impl TableProvider for GenerateSeriesTable {
174175
};
175176

176177
Ok(Arc::new(LazyMemoryExec::try_new(
177-
self.schema.clone(),
178+
self.schema(),
178179
vec![Arc::new(RwLock::new(state))],
179180
)?))
180181
}

datafusion/substrait/src/logical_plan/consumer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ pub async fn from_project_rel(
10601060
) -> Result<LogicalPlan> {
10611061
if let Some(input) = p.input.as_ref() {
10621062
let mut input = LogicalPlanBuilder::from(consumer.consume_rel(input).await?);
1063-
let original_schema = input.schema().clone();
1063+
let original_schema = Arc::clone(input.schema());
10641064

10651065
// Ensure that all expressions have a unique display name, so that
10661066
// validate_unique_names does not fail when constructing the project.
@@ -1626,7 +1626,7 @@ fn apply_emit_kind(
16261626
.get(field as usize)
16271627
.ok_or_else(|| substrait_datafusion_err!(
16281628
"Emit output field {} cannot be resolved in input schema {}",
1629-
field, proj.input.schema().clone()
1629+
field, proj.input.schema()
16301630
))?;
16311631
exprs.push(name_tracker.get_uniquely_named_expr(expr.clone())?);
16321632
}

0 commit comments

Comments
 (0)