Update datafusion-core crate to Rust 2024 edition#19332
Update datafusion-core crate to Rust 2024 edition#19332timsaucer merged 1 commit intoapache:mainfrom
Conversation
|
I broke from the original plan and did just this one crate since it is such a large diff. |
alamb
left a comment
There was a problem hiding this comment.
Looks good to me -- thanks @timsaucer
| readme = "../../README.md" | ||
| version = { workspace = true } | ||
| edition = { workspace = true } | ||
| edition = "2024" |
There was a problem hiding this comment.
Pull request overview
This PR updates the datafusion-core crate to Rust 2024 edition as part of a gradual migration strategy. The changes are purely stylistic and leverage Rust 2024 features like let chains while maintaining backward compatibility.
Key Changes:
- Edition update in Cargo.toml from 2021 to 2024
- Import reordering to follow rustfmt 2024 conventions
- Adoption of let chains to simplify nested if-let patterns
- Code formatting improvements (line breaks, alignment)
Reviewed changes
Copilot reviewed 128 out of 129 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| datafusion/core/Cargo.toml | Updates edition from workspace default to "2024" |
| Test files (user_defined/*.rs) | Import reordering and let chains adoption |
| Test files (sql/.rs, physical_optimizer/.rs) | Formatting improvements, let chains, and import sorting |
| Test files (parquet/.rs, fuzz_cases/.rs) | Pattern matching updates and formatting consistency |
| Core source files (src/*.rs) | Import reordering, let chains, and code formatting |
| Benchmark files (benches/*.rs) | Import statement reordering and variable renaming |
All changes are non-functional and maintain existing behavior while taking advantage of Rust 2024 edition features. The migration follows best practices by updating a single crate incrementally rather than attempting a large-scale change across the entire codebase.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b2c7f1f to
673dac8
Compare
673dac8 to
f59ee9a
Compare
Which issue does this PR close?
This addresses part of #15804 but does not close it.
Rationale for this change
Now that we are on MSRV 1.88 we can use rust edition 2024, which brings let chains and other nice features. It also improves
unsafechecking. In order to introduce these changes in slower way instead of one massive PR that is too difficult to manage we are updating a few crates at a time.What changes are included in this PR?
Updates these crates to 2024.
Are these changes tested?
Existing unit tests. There are no functional code changes.
Are there any user-facing changes?
None.
Note
It is recommended to review with the ignore whitespace setting: https://github.com/apache/datafusion/pull/19332/files?w=1