Skip to content

Commit 9c0c77d

Browse files
authored
chore(template): Template Rust edition in rustfmt config (#498)
1 parent f1f1a9e commit 9c0c77d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

config/versions.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ rust_version: 1.85.0
99
# used in the operator-rs repository.
1010
rust_nightly_version: nightly-2025-01-15
1111

12+
# This edition is mostly used for rustfmt commands and the rustfmt config file. The edition should
13+
# be kept in line with the edition in the operator-rs repository.
14+
rust_edition: 2024
15+
1216
# IMPORTANT
1317
# If you change the Hadolint version here, make sure to also change the hook
1418
# refs in the local and templated .pre-commit-config.yaml files.

template/.vscode/settings.json.j2

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"rust-analyzer.rustfmt.overrideCommand": [
33
"rustfmt",
44
"+{[rust_nightly_version}]",
5+
"--edition",
6+
"{[rust_edition}]",
57
"--"
68
],
79
}

template/rustfmt.toml renamed to template/rustfmt.toml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered.
33

44
# https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-style-edition.html
5-
style_edition = "2024"
5+
style_edition = "{[rust_edition}]"
66
imports_granularity = "Crate"
77
group_imports = "StdExternalCrate"
88
reorder_impl_items = true

0 commit comments

Comments
 (0)