Introduce formatting infra for Rust and format Rust code - #1037
Introduce formatting infra for Rust and format Rust code#1037LittleHuba wants to merge 3 commits into
Conversation
|
Requested feedback from @bharatGoswami8 whether rustfmt config is fine for him. |
8ac9e10 to
46b7939
Compare
46b7939 to
85a9d2a
Compare
Edition 2021 seems to be the agreed upon edition in S-CORE for now.
85a9d2a to
76e971d
Compare
|
Please rename PR title, it is misleading. It is doing more than just formatting |
| srcs = ["score_com.rs"], | ||
| crate_name = "score_com", | ||
| edition = "2024", | ||
| edition = "2021", |
There was a problem hiding this comment.
will revert back this once score_rust_policies upgrade to 2024
Ticket created for same -
eclipse-score/score_rust_policies#13
| @@ -17,7 +17,7 @@ rust_library( | |||
| name = "com-api-example-lib", | |||
| srcs = glob(["src/**/*.rs"]), | |||
| crate_name = "com_api_example", | |||
There was a problem hiding this comment.
Edition 2021 seems to be the agreed upon edition in S-CORE for now.
Please update the commit message to link where S-CORE says that Rust 2021 should be used.
| srcs = glob(["src/**/*.rs"]), | ||
| crate_name = "com_api_example", | ||
| edition = "2024", | ||
| edition = "2021", |
There was a problem hiding this comment.
Why are we specifying rust edition per target? This is like in C++ we would specify the C++ version per target. If edition is not specified, it defaults to the one used by the toolchain.
If there is no good reason to specify the edition in every single target, I would like we specify it only in the toolchain.
There was a problem hiding this comment.
Fair point. @bharatGoswami8 if you do not disagree, I'll do that change.
There was a problem hiding this comment.
Agreed as we are going to use default so we can remove this completely - https://github.com/eclipse-score/toolchains_rust/blob/main/toolchains/x86_64-unknown-linux-gnu/BUILD.bazel#L24
|
This PR is blocked by eclipse-score/score_rust_policies#13 |
Created a ticket to upgrade the Rust Edition 2024: eclipse-score/toolchains_rust#42 |
No description provided.