@@ -22,9 +22,9 @@ In the `Cargo.toml`, the `[workspace]` table supports the following sections:
22
22
* [ ` members ` ] ( #the-members-and-exclude-fields ) — Packages to include in the workspace.
23
23
* [ ` exclude ` ] ( #the-members-and-exclude-fields ) — Packages to exclude from the workspace.
24
24
* [ ` default-members ` ] ( #the-default-members-field ) — Packages to operate on when a specific package wasn't selected.
25
- * [ ` metadata ` ] ( #the-metadata-table ) — Extra settings for external tools.
26
25
* [ ` package ` ] ( #the-package-table ) — Keys for inheriting in packages.
27
26
* [ ` dependencies ` ] ( #the-dependencies-table ) — Keys for inheriting in package dependencies.
27
+ * [ ` metadata ` ] ( #the-metadata-table ) — Extra settings for external tools.
28
28
* [ ` [patch] ` ] ( overriding-dependencies.md#the-patch-section ) — Override dependencies.
29
29
* [ ` [replace] ` ] ( overriding-dependencies.md#the-replace-section ) — Override dependencies (deprecated).
30
30
* [ ` [profile] ` ] ( profiles.md ) — Compiler settings and optimizations.
@@ -131,29 +131,6 @@ default-members = ["path/to/member2", "path/to/member3/foo"]
131
131
132
132
When specified, ` default-members ` must expand to a subset of ` members ` .
133
133
134
- ### The ` metadata ` table
135
-
136
- The ` workspace.metadata ` table is ignored by Cargo and will not be warned
137
- about. This section can be used for tools that would like to store workspace
138
- configuration in ` Cargo.toml ` . For example:
139
-
140
- ``` toml
141
- [workspace ]
142
- members = [" member1" , " member2" ]
143
-
144
- [workspace .metadata .webcontents ]
145
- root = " path/to/webproject"
146
- tool = [" npm" , " run" , " build" ]
147
- # ...
148
- ```
149
-
150
- There is a similar set of tables at the package level at
151
- [ ` package.metadata ` ] [ package-metadata ] . While cargo does not specify a
152
- format for the content of either of these tables, it is suggested that
153
- external tools may wish to use them in a consistent fashion, such as referring
154
- to the data in ` workspace.metadata ` if data is missing from ` package.metadata ` ,
155
- if that makes sense for the tool in question.
156
-
157
134
### The ` package ` table
158
135
159
136
The ` workspace.package ` table is where you define keys that can be
@@ -238,6 +215,29 @@ cc.workspace = true
238
215
rand.workspace = true
239
216
```
240
217
218
+ ### The ` metadata ` table
219
+
220
+ The ` workspace.metadata ` table is ignored by Cargo and will not be warned
221
+ about. This section can be used for tools that would like to store workspace
222
+ configuration in ` Cargo.toml ` . For example:
223
+
224
+ ``` toml
225
+ [workspace ]
226
+ members = [" member1" , " member2" ]
227
+
228
+ [workspace .metadata .webcontents ]
229
+ root = " path/to/webproject"
230
+ tool = [" npm" , " run" , " build" ]
231
+ # ...
232
+ ```
233
+
234
+ There is a similar set of tables at the package level at
235
+ [ ` package.metadata ` ] [ package-metadata ] . While cargo does not specify a
236
+ format for the content of either of these tables, it is suggested that
237
+ external tools may wish to use them in a consistent fashion, such as referring
238
+ to the data in ` workspace.metadata ` if data is missing from ` package.metadata ` ,
239
+ if that makes sense for the tool in question.
240
+
241
241
[ package ] : manifest.md#the-package-section
242
242
[ package-metadata ] : manifest.md#the-metadata-table
243
243
[ output directory ] : ../guide/build-cache.md
0 commit comments