Skip to content

style: make clippy happy and remove redundant prefix #6624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datafusion-cli/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ mod tests {

async fn create_external_table_test(location: &str, sql: &str) -> Result<()> {
let ctx = SessionContext::new();
let plan = ctx.state().create_logical_plan(&sql).await?;
let plan = ctx.state().create_logical_plan(sql).await?;

match &plan {
LogicalPlan::Ddl(DdlStatement::CreateExternalTable(cmd)) => {
create_external_table(&ctx, cmd).await?;
}
_ => assert!(false),
_ => unreachable!(),
};

ctx.runtime_env()
Expand Down
2 changes: 1 addition & 1 deletion datafusion-cli/src/object_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub async fn get_s3_object_store_builder(
.ok_or_else(|| {
DataFusionError::ObjectStore(object_store::Error::Generic {
store: "S3",
source: format!("Failed to get S3 credentials from environment")
source: "Failed to get S3 credentials from environment".to_string()
.into(),
})
})?
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/file_format/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ impl ReadOptions<'_> for NdJsonReadOptions<'_> {
#[async_trait]
impl ReadOptions<'_> for AvroReadOptions<'_> {
fn to_listing_options(&self, config: &SessionConfig) -> ListingOptions {
let file_format = AvroFormat::default();
let file_format = AvroFormat;

ListingOptions::new(Arc::new(file_format))
.with_file_extension(self.file_extension)
Expand All @@ -535,7 +535,7 @@ impl ReadOptions<'_> for AvroReadOptions<'_> {
#[async_trait]
impl ReadOptions<'_> for ArrowReadOptions<'_> {
fn to_listing_options(&self, config: &SessionConfig) -> ListingOptions {
let file_format = ArrowFormat::default();
let file_format = ArrowFormat;

ListingOptions::new(Arc::new(file_format))
.with_file_extension(self.file_extension)
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/listing/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ impl ListingTableConfig {
.map_err(|_| DataFusionError::Internal(err_msg))?;

let file_format: Arc<dyn FileFormat> = match file_type {
FileType::ARROW => Arc::new(ArrowFormat::default()),
FileType::AVRO => Arc::new(AvroFormat::default()),
FileType::ARROW => Arc::new(ArrowFormat),
FileType::AVRO => Arc::new(AvroFormat),
FileType::CSV => Arc::new(
CsvFormat::default().with_file_compression_type(file_compression_type),
),
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/listing_table_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ impl TableProviderFactory for ListingTableFactory {
.with_file_compression_type(file_compression_type),
),
FileType::PARQUET => Arc::new(ParquetFormat::default()),
FileType::AVRO => Arc::new(AvroFormat::default()),
FileType::AVRO => Arc::new(AvroFormat),
FileType::JSON => Arc::new(
JsonFormat::default().with_file_compression_type(file_compression_type),
),
FileType::ARROW => Arc::new(ArrowFormat::default()),
FileType::ARROW => Arc::new(ArrowFormat),
};

let (provided_schema, table_partition_cols) = if cmd.schema.fields().is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/physical_plan/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn create_output_batch(
plan_builder.append_value(total_rows.to_string());

type_builder.append_value("Duration");
plan_builder.append_value(format!("{:?}", duration));
plan_builder.append_value(format!("{duration:?}"));
}

RecordBatch::try_new(
Expand Down
6 changes: 3 additions & 3 deletions datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ impl fmt::Debug for Expr {
write!(f, " FILTER (WHERE {fe})")?;
}
if let Some(ob) = order_by {
write!(f, " ORDER BY {:?}", ob)?;
write!(f, " ORDER BY {ob:?}")?;
}
Ok(())
}
Expand All @@ -1008,7 +1008,7 @@ impl fmt::Debug for Expr {
write!(f, " FILTER (WHERE {fe})")?;
}
if let Some(ob) = order_by {
write!(f, " ORDER BY {:?}", ob)?;
write!(f, " ORDER BY {ob:?}")?;
}
Ok(())
}
Expand Down Expand Up @@ -1374,7 +1374,7 @@ fn create_name(e: &Expr) -> Result<String> {
info += &format!(" FILTER (WHERE {fe})");
}
if let Some(ob) = order_by {
info += &format!(" ORDER BY ({:?})", ob);
info += &format!(" ORDER BY ({ob:?})");
}
Ok(format!("{}({}){}", fun.name, names.join(","), info))
}
Expand Down
Loading