From bec1771c444cba615b1b5743519967ee4d5595c4 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Tue, 3 Mar 2026 21:20:08 -0800 Subject: [PATCH] Update edition in `.rustfmt.toml` and pre-commit hook (#4543) # Description of Changes We've updated to 2024 (https://github.com/clockworklabs/SpacetimeDB/pull/3802). I'm just adding `edition` to `.rustfmt.toml`, and removing the hardcoded edition from the pre-commit hook. This fixes the pre-commit hook complaining about us using Rust 2024 features. # API and ABI breaking changes None # Expected complexity level and risk 1 # Testing - [x] `rustfmt crates/auth/src/identity.rs` now succeeds for me --------- Co-authored-by: Zeke Foppa --- .rustfmt.toml | 1 + git-hooks/hooks/pre-commit | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index 060859441..b283695d7 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,2 +1,3 @@ max_width = 120 style_edition = "2021" +edition = "2024" diff --git a/git-hooks/hooks/pre-commit b/git-hooks/hooks/pre-commit index 60e5c2b2c..2ece19000 100755 --- a/git-hooks/hooks/pre-commit +++ b/git-hooks/hooks/pre-commit @@ -77,7 +77,7 @@ if [ -n "$exe" ]; then if [[ "$line" == *.rs ]]; then echo "Formatting changed file: ${line:3}..." # format file - rustfmt --edition 2021 "$git_repo/${line:3}" + rustfmt "$git_repo/${line:3}" # add changes git add "$git_repo/${line:3}" fi