Skip to content

Update codegen to use clippy approved let chains#501

Merged
DavisVaughan merged 1 commit into
mainfrom
feature/generated-2024-edition
Jun 10, 2026
Merged

Update codegen to use clippy approved let chains#501
DavisVaughan merged 1 commit into
mainfrom
feature/generated-2024-edition

Conversation

@DavisVaughan

Copy link
Copy Markdown
Collaborator

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.

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.
Comment thread xtask/src/lib.rs
ensure_rustfmt()?;
let output = run!(
"rustfmt --config newline_style=Unix";
"rustfmt --edition 2024 --config newline_style=Unix";

@DavisVaughan DavisVaughan Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@DavisVaughan DavisVaughan merged commit 9312453 into main Jun 10, 2026
4 checks passed
@DavisVaughan DavisVaughan deleted the feature/generated-2024-edition branch June 10, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant