@@ -520,13 +520,7 @@ pub fn to_real_manifest(
520
520
let workspace_config = match ( original_toml. workspace . as_ref ( ) , package. workspace . as_ref ( ) ) {
521
521
( Some ( toml_config) , None ) => {
522
522
verify_lints ( toml_config. lints . as_ref ( ) ) ?;
523
- let inheritable = InheritableFields {
524
- package : toml_config. package . clone ( ) ,
525
- dependencies : toml_config. dependencies . clone ( ) ,
526
- lints : toml_config. lints . clone ( ) ,
527
- _ws_root : package_root. to_path_buf ( ) ,
528
- } ;
529
- if let Some ( ws_deps) = & inheritable. dependencies {
523
+ if let Some ( ws_deps) = & toml_config. dependencies {
530
524
for ( name, dep) in ws_deps {
531
525
unused_dep_keys (
532
526
name,
@@ -536,14 +530,7 @@ pub fn to_real_manifest(
536
530
) ;
537
531
}
538
532
}
539
- let ws_root_config = WorkspaceRootConfig :: new (
540
- package_root,
541
- & toml_config. members ,
542
- & toml_config. default_members ,
543
- & toml_config. exclude ,
544
- & Some ( inheritable) ,
545
- & toml_config. metadata ,
546
- ) ;
533
+ let ws_root_config = to_workspace_config ( toml_config, package_root) ;
547
534
gctx. ws_roots
548
535
. borrow_mut ( )
549
536
. insert ( package_root. to_path_buf ( ) , ws_root_config. clone ( ) ) ;
@@ -1246,6 +1233,27 @@ pub fn to_real_manifest(
1246
1233
Ok ( manifest)
1247
1234
}
1248
1235
1236
+ fn to_workspace_config (
1237
+ resolved_toml : & manifest:: TomlWorkspace ,
1238
+ package_root : & Path ,
1239
+ ) -> WorkspaceRootConfig {
1240
+ let inheritable = InheritableFields {
1241
+ package : resolved_toml. package . clone ( ) ,
1242
+ dependencies : resolved_toml. dependencies . clone ( ) ,
1243
+ lints : resolved_toml. lints . clone ( ) ,
1244
+ _ws_root : package_root. to_owned ( ) ,
1245
+ } ;
1246
+ let ws_root_config = WorkspaceRootConfig :: new (
1247
+ package_root,
1248
+ & resolved_toml. members ,
1249
+ & resolved_toml. default_members ,
1250
+ & resolved_toml. exclude ,
1251
+ & Some ( inheritable) ,
1252
+ & resolved_toml. metadata ,
1253
+ ) ;
1254
+ ws_root_config
1255
+ }
1256
+
1249
1257
fn load_inheritable_fields (
1250
1258
gctx : & GlobalContext ,
1251
1259
resolved_path : & Path ,
@@ -1337,20 +1345,7 @@ fn to_virtual_manifest(
1337
1345
let workspace_config = match original_toml. workspace {
1338
1346
Some ( ref toml_config) => {
1339
1347
verify_lints ( toml_config. lints . as_ref ( ) ) ?;
1340
- let inheritable = InheritableFields {
1341
- package : toml_config. package . clone ( ) ,
1342
- dependencies : toml_config. dependencies . clone ( ) ,
1343
- lints : toml_config. lints . clone ( ) ,
1344
- _ws_root : root. to_path_buf ( ) ,
1345
- } ;
1346
- let ws_root_config = WorkspaceRootConfig :: new (
1347
- root,
1348
- & toml_config. members ,
1349
- & toml_config. default_members ,
1350
- & toml_config. exclude ,
1351
- & Some ( inheritable) ,
1352
- & toml_config. metadata ,
1353
- ) ;
1348
+ let ws_root_config = to_workspace_config ( toml_config, root) ;
1354
1349
gctx. ws_roots
1355
1350
. borrow_mut ( )
1356
1351
. insert ( root. to_path_buf ( ) , ws_root_config. clone ( ) ) ;
0 commit comments