Skip to content

Commit 4207291

Browse files
Dandandanclaude
andauthored
Update Rust toolchain to 1.97.0 (#23430)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #23431 ## Rationale for this change Bump the pinned Rust toolchain from 1.96.1 to 1.97.0 and fix the new Clippy lints introduced in this release (useless_borrows_in_formatting, question_mark, manual match-to-`?` rewrites, and uninlined_format_args). ## What changes are included in this PR? Bump the pinned Rust toolchain from 1.96.1 to 1.97.0 ## Are these changes tested? ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1dc73dc commit 4207291

40 files changed

Lines changed: 111 additions & 137 deletions

File tree

benchmarks/src/imdb/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl ConvertOpt {
8282

8383
println!(
8484
"Converting '{}' to {} files in directory '{}'",
85-
&input_path, self.file_format, &output_path
85+
input_path, self.file_format, output_path
8686
);
8787
match self.file_format.as_str() {
8888
"csv" => {

datafusion-examples/examples/external_dependency/query_aws_s3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub async fn query_aws_s3() -> Result<()> {
6666
// dynamic query by the file path
6767
let ctx = ctx.enable_url_table();
6868
let df = ctx
69-
.sql(format!(r#"SELECT * FROM '{}' LIMIT 10"#, &path).as_str())
69+
.sql(format!(r#"SELECT * FROM '{path}' LIMIT 10"#).as_str())
7070
.await?;
7171

7272
// print the results

datafusion/common/src/column.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl Column {
271271
})
272272
.map_err(|err| {
273273
let mut diagnostic = Diagnostic::new_error(
274-
format!("column '{}' is ambiguous", &self.name),
274+
format!("column '{}' is ambiguous", self.name),
275275
self.spans().first(),
276276
);
277277
// TODO If [`DFSchema`] had spans, we could show the

datafusion/common/src/error.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,14 +687,11 @@ impl DataFusionError {
687687
return Some(diagnostics);
688688
}
689689

690-
if let Some(source) = self
691-
.head
692-
.source()
693-
.and_then(|source| source.downcast_ref::<DataFusionError>())
694690
{
691+
let source = self.head.source().and_then(|source| {
692+
source.downcast_ref::<DataFusionError>()
693+
})?;
695694
self.head = source;
696-
} else {
697-
return None;
698695
}
699696
}
700697
}

datafusion/core/src/datasource/file_format/csv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ mod tests {
702702
) -> Result<usize> {
703703
let df = ctx.sql(&format!("EXPLAIN {sql}")).await?;
704704
let result = df.collect().await?;
705-
let plan = format!("{}", &pretty_format_batches(&result)?);
705+
let plan = format!("{}", pretty_format_batches(&result)?);
706706

707707
let re = Regex::new(r"DataSourceExec: file_groups=\{(\d+) group").unwrap();
708708

datafusion/core/src/datasource/file_format/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ mod tests {
230230
.collect()
231231
.await?;
232232

233-
let plan = format!("{}", &pretty::pretty_format_batches(&result)?);
233+
let plan = format!("{}", pretty::pretty_format_batches(&result)?);
234234

235235
let re = Regex::new(r"file_groups=\{(\d+) group").unwrap();
236236

datafusion/core/src/datasource/listing/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl ListingTableConfigExt for ListingTableConfig {
8787

8888
let listing_file_extension =
8989
if let Some(compression_type) = maybe_compression_type {
90-
format!("{}.{}", &file_extension, &compression_type)
90+
format!("{file_extension}.{compression_type}")
9191
} else {
9292
file_extension
9393
};

datafusion/core/src/execution/context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ mod tests {
25642564
let ctx = SessionContext::new_with_state(session_state).enable_url_table();
25652565
let result = plan_and_collect(
25662566
&ctx,
2567-
format!("select c_name from '{}' limit 3;", &url).as_str(),
2567+
format!("select c_name from '{url}' limit 3;").as_str(),
25682568
)
25692569
.await?;
25702570

datafusion/core/tests/fuzz_cases/join_fuzz.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,14 +1008,12 @@ impl JoinFuzzTestCase {
10081008

10091009
if join_tests.contains(&HjSmj) {
10101010
let err_msg_row_cnt = format!(
1011-
"HashJoinExec and SortMergeJoinExec produced different row counts, batch_size: {}",
1012-
&batch_size
1011+
"HashJoinExec and SortMergeJoinExec produced different row counts, batch_size: {batch_size}"
10131012
);
10141013
assert_eq!(hj_rows, smj_rows, "{}", err_msg_row_cnt.as_str());
10151014

10161015
let err_msg_contents = format!(
1017-
"SortMergeJoinExec and HashJoinExec produced different results, batch_size: {}",
1018-
&batch_size
1016+
"SortMergeJoinExec and HashJoinExec produced different results, batch_size: {batch_size}"
10191017
);
10201018
// row level compare if any of joins returns the result
10211019
// the reason is different formatting when there is no rows
@@ -1070,10 +1068,10 @@ impl JoinFuzzTestCase {
10701068
let mut file = std::fs::File::create(&file_path).unwrap();
10711069
println!(
10721070
"{}: Saving batch idx {} rows {} to parquet {}",
1073-
&out_name,
1071+
out_name,
10741072
idx,
10751073
batch.num_rows(),
1076-
&file_path
1074+
file_path
10771075
);
10781076
let mut writer = parquet::arrow::ArrowWriter::try_new(
10791077
&mut file,

datafusion/datasource-arrow/src/file_format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl DisplayAs for ArrowFileSink {
356356
}
357357
DisplayFormatType::TreeRender => {
358358
writeln!(f, "format: arrow")?;
359-
write!(f, "file={}", &self.config.original_url)
359+
write!(f, "file={}", self.config.original_url)
360360
}
361361
}
362362
}
@@ -380,7 +380,7 @@ impl DataSink for ArrowFileSink {
380380
// Custom implementation of inferring schema. Should eventually be moved upstream to arrow-rs.
381381
// See <https://github.com/apache/arrow-rs/issues/5021>
382382

383-
const ARROW_MAGIC: [u8; 6] = [b'A', b'R', b'R', b'O', b'W', b'1'];
383+
const ARROW_MAGIC: [u8; 6] = *b"ARROW1";
384384
const CONTINUATION_MARKER: [u8; 4] = [0xff; 4];
385385

386386
async fn infer_stream_schema(

0 commit comments

Comments
 (0)