From 5f57a50da43ff4f4c36afa7f27fcd7a96c2c7859 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 2 Apr 2025 15:16:41 +0200 Subject: [PATCH 1/7] chore(template): Bump rust to 1.85.0 --- config/versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f32559bbfbc6bbbcbe1bfd3319fa115b4066039b Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 2 Apr 2025 15:17:15 +0200 Subject: [PATCH 2/7] chore(template): Add vscode settings for rustfmt --- template/.vscode/settings.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 template/.vscode/settings.json diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json new file mode 100644 index 00000000..ddcd8aac --- /dev/null +++ b/template/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "rust-analyzer.rustfmt.overrideCommand": [ + "rustfmt", + "+nightly-2025-01-15", + "--" + ], +} From 4c9a7a97bbe885e58e27777c0836979179909998 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 2 Apr 2025 15:17:38 +0200 Subject: [PATCH 3/7] chore(template): Use Rust 2024 style --- template/rustfmt.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template/rustfmt.toml b/template/rustfmt.toml index e25d3967..4c81dfef 100644 --- a/template/rustfmt.toml +++ b/template/rustfmt.toml @@ -1,5 +1,7 @@ # 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" From 4e091993540f94178d3abc1ec9c7e3b80b906f3f Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 2 Apr 2025 15:17:58 +0200 Subject: [PATCH 4/7] chore(template): Add additional rustfmt settings used in operator-rs --- template/rustfmt.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/template/rustfmt.toml b/template/rustfmt.toml index 4c81dfef..07217b21 100644 --- a/template/rustfmt.toml +++ b/template/rustfmt.toml @@ -4,4 +4,6 @@ # 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 From e97a77b5f078f3e753f15eb4654d202f0d567764 Mon Sep 17 00:00:00 2001 From: Nick <10092581+NickLarsenNZ@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:23:20 +0200 Subject: [PATCH 5/7] Apply suggestions from code review Co-authored-by: Techassi --- template/.vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json index ddcd8aac..d8e83e34 100644 --- a/template/.vscode/settings.json +++ b/template/.vscode/settings.json @@ -1,7 +1,7 @@ { "rust-analyzer.rustfmt.overrideCommand": [ "rustfmt", - "+nightly-2025-01-15", + "{[rust_nightly_version}]", "--" ], } From 2f07847fd8555f314f404ab88b5b278996ecf3a8 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 2 Apr 2025 15:28:07 +0200 Subject: [PATCH 6/7] chore(template): Jinja it up --- template/.vscode/{settings.json => settings.json.j2} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename template/.vscode/{settings.json => settings.json.j2} (100%) diff --git a/template/.vscode/settings.json b/template/.vscode/settings.json.j2 similarity index 100% rename from template/.vscode/settings.json rename to template/.vscode/settings.json.j2 From c7b1190b3274045da910e070bd199e90571add80 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Wed, 2 Apr 2025 15:29:42 +0200 Subject: [PATCH 7/7] chore(template): Additional commit --- template/.vscode/settings.json.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.vscode/settings.json.j2 b/template/.vscode/settings.json.j2 index d8e83e34..46954211 100644 --- a/template/.vscode/settings.json.j2 +++ b/template/.vscode/settings.json.j2 @@ -1,7 +1,7 @@ { "rust-analyzer.rustfmt.overrideCommand": [ "rustfmt", - "{[rust_nightly_version}]", + "+{[rust_nightly_version}]", "--" ], }