Update codegen to use clippy approved let chains#501
Merged
Conversation
Without this, we get a ton of clippy warnings because we use 2024 edition Rust now. clippy and the Problems pane are now once again useful.
DavisVaughan
commented
Jun 10, 2026
| ensure_rustfmt()?; | ||
| let output = run!( | ||
| "rustfmt --config newline_style=Unix"; | ||
| "rustfmt --edition 2024 --config newline_style=Unix"; |
Collaborator
Author
There was a problem hiding this comment.
rustfmt defaults to 2015 edition! Let-chains did not exist there.
rustfmt does not respect rust-toolchain.toml or our top level edition = "2024" in Cargo.toml because it is meant to be used as a standalone tool
cargo fmt on the other hand would find and respect edition = "2024", but we are using this thing to format stdin, which cargo fmt cannot do.
So after a bunch of research, I think hardcoding this is probably the best and easiest option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this, we get a ton of clippy warnings because we use 2024 edition Rust now. clippy and the Problems pane are now once again useful.