diff --git a/config/versions.yaml b/config/versions.yaml index c07f3436..5d7f1abf 100644 --- a/config/versions.yaml +++ b/config/versions.yaml @@ -2,7 +2,7 @@ # IMPORTANT # If you change the Rust toolchain version here, make sure to also change # docker-images/ubi8-rust-builder/Dockerfile & docker-images/ubi9-rust-builder/Dockerfile -rust_version: 1.84.1 +rust_version: 1.85.0 # This nightly version is only used for cargo fmt invocations, because we use nightly-only # rustfmt config options in rustfmt.toml. The version should be kept in line with the version diff --git a/template/.vscode/settings.json.j2 b/template/.vscode/settings.json.j2 new file mode 100644 index 00000000..46954211 --- /dev/null +++ b/template/.vscode/settings.json.j2 @@ -0,0 +1,7 @@ +{ + "rust-analyzer.rustfmt.overrideCommand": [ + "rustfmt", + "+{[rust_nightly_version}]", + "--" + ], +} diff --git a/template/rustfmt.toml b/template/rustfmt.toml index e25d3967..07217b21 100644 --- a/template/rustfmt.toml +++ b/template/rustfmt.toml @@ -1,5 +1,9 @@ # This file includes unstable features, so you need to run "cargo +nightly fmt" to format your code. # It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered. +# https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-style-edition.html +style_edition = "2024" imports_granularity = "Crate" -group_imports = "StdExternalCrate" +group_imports = "StdExternalCrate" +reorder_impl_items = true +use_field_init_shorthand = true