Skip to content

Commit 8a1fd4b

Browse files
committed
Use cargo reference manifest section order
In [#131] I added a check that ensures that the section in `Cargo.toml` (and there values) are in a specific order. I invented the order quite randomly, in the order which I thought might be useful. This PR changes the order to be the same as in Cargo's reference about [The Manifest Format]. Also some missing softlinks were added. [#131]: <#131> [The Manifest Format]: <https://doc.rust-lang.org/cargo/reference/manifest.html>
1 parent b160565 commit 8a1fd4b

File tree

10 files changed

+59
-36
lines changed

10 files changed

+59
-36
lines changed

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
[workspace]
2-
members = [
3-
"rinja",
4-
"rinja_derive",
5-
"rinja_parser",
6-
"testing",
7-
]
2+
members = ["rinja", "rinja_derive", "rinja_parser", "testing"]
83
resolver = "2"

examples/actix-web-app/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# In a real application you would not need this section. It is only used in here, so that this
2-
# example can have a more lenient MSRV (minimum supported rust version) than rinja as a whole.
3-
[workspace]
4-
members = ["."]
51

62
[package]
73
name = "actix-web-app"
@@ -28,3 +24,8 @@ env_logger = "0.11.3"
2824
log = "0.4.22"
2925
pretty-error-debug = "0.3.0"
3026
thiserror = "2.0.3"
27+
28+
# In a real application you would not need this section. It is only used in here, so that this
29+
# example can have a more lenient MSRV (minimum supported rust version) than rinja as a whole.
30+
[workspace]
31+
members = ["."]

rinja_derive/.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.rustfmt.toml

rinja_derive/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
1717
[lib]
1818
proc-macro = true
1919

20-
[features]
21-
code-in-doc = ["dep:pulldown-cmark"]
22-
config = ["dep:serde", "dep:basic-toml", "parser/config"]
23-
urlencode = []
24-
serde_json = []
25-
2620
[dependencies]
2721
parser = { package = "rinja_parser", version = "=0.3.5", path = "../rinja_parser" }
2822

@@ -44,6 +38,12 @@ prettyplease = "0.2.20"
4438
similar = "2.6.0"
4539
syn = { version = "2.0.3", features = ["full"] }
4640

41+
[features]
42+
code-in-doc = ["dep:pulldown-cmark"]
43+
config = ["dep:serde", "dep:basic-toml", "parser/config"]
44+
urlencode = []
45+
serde_json = []
46+
4747
[lints.rust]
4848
# Used in `rinja_derive_standalone` which uses the same source folder, but is not a proc-macro.
4949
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(feature, values("__standalone"))'] }

rinja_derive/_typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_typos.toml

rinja_derive/deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../deny.toml

rinja_derive/tomlfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../tomlfmt.toml

rinja_derive_standalone/Cargo.toml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[workspace]
2-
members = ["."]
31

42
[package]
53
name = "rinja_derive_standalone"
@@ -17,14 +15,10 @@ publish = false
1715
all-features = true
1816
rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
1917

20-
[features]
21-
default = ["__standalone"]
22-
__standalone = []
23-
24-
code-in-doc = ["dep:pulldown-cmark"]
25-
config = ["dep:serde", "dep:basic-toml", "parser/config"]
26-
urlencode = []
27-
serde_json = []
18+
[[bench]]
19+
name = "derive-template"
20+
harness = false
21+
required-features = ["__standalone"]
2822

2923
[dependencies]
3024
parser = { package = "rinja_parser", version = "=0.3.5", path = "../rinja_parser" }
@@ -48,7 +42,14 @@ prettyplease = "0.2.20"
4842
similar = "2.6.0"
4943
syn = { version = "2.0.3", features = ["full"] }
5044

51-
[[bench]]
52-
name = "derive-template"
53-
harness = false
54-
required-features = ["__standalone"]
45+
[features]
46+
default = ["__standalone"]
47+
__standalone = []
48+
49+
code-in-doc = ["dep:pulldown-cmark"]
50+
config = ["dep:serde", "dep:basic-toml", "parser/config"]
51+
urlencode = []
52+
serde_json = []
53+
54+
[workspace]
55+
members = ["."]

rinja_parser/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ rust-version = "1.80"
1717
all-features = true
1818
rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
1919

20-
[features]
21-
config = ["dep:serde"]
20+
[[bench]]
21+
name = "from_str"
22+
harness = false
2223

2324
[dependencies]
2425
memchr = "2"
@@ -28,6 +29,5 @@ winnow = "0.4"
2829
[dev-dependencies]
2930
criterion = "0.5"
3031

31-
[[bench]]
32-
name = "from_str"
33-
harness = false
32+
[features]
33+
config = ["dep:serde"]

tomlfmt.toml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
table_order = ["workspace", "package", "badges", "lib", "features", "dependencies", "build-dependencies", "dev-dependencies", "bench"]
1+
# Keep in the same order as <https://doc.rust-lang.org/cargo/reference/manifest.html>
2+
table_order = [
3+
"package",
4+
# targets
5+
"lib",
6+
"bin",
7+
"example",
8+
"test",
9+
"bench",
10+
# dependencies
11+
"dependencies",
12+
"dev-dependencies",
13+
"build-dependencies",
14+
"target",
15+
# misc
16+
"badges",
17+
"features",
18+
"lints",
19+
"patch",
20+
"replace",
21+
"profile",
22+
"workspace",
23+
]

0 commit comments

Comments
 (0)