@@ -661,9 +661,7 @@ impl schema::TomlManifest {
661
661
662
662
let mut deps: BTreeMap < String , schema:: InheritableDependency > = BTreeMap :: new ( ) ;
663
663
for ( n, v) in dependencies. iter ( ) {
664
- let resolved = v
665
- . clone ( )
666
- . inherit_with ( n, |dep| dep. inherit_with ( n, inheritable, cx) ) ?;
664
+ let resolved = v. clone ( ) . inherit_with ( n, inheritable, cx) ?;
667
665
let dep = resolved. to_dependency ( n, cx, kind) ?;
668
666
let name_in_toml = dep. name_in_toml ( ) . as_str ( ) ;
669
667
validate_package_name ( name_in_toml, "dependency name" , "" ) ?;
@@ -1573,15 +1571,16 @@ impl<T> schema::InheritableField<T> {
1573
1571
impl schema:: InheritableDependency {
1574
1572
fn inherit_with < ' a > (
1575
1573
self ,
1576
- label : & str ,
1577
- get_ws_inheritable : impl FnOnce ( & schema:: TomlInheritedDependency ) -> CargoResult < TomlDependency > ,
1574
+ name : & str ,
1575
+ inheritable : impl FnOnce ( ) -> CargoResult < & ' a InheritableFields > ,
1576
+ cx : & mut Context < ' _ , ' _ > ,
1578
1577
) -> CargoResult < TomlDependency > {
1579
1578
match self {
1580
1579
schema:: InheritableDependency :: Value ( value) => Ok ( value) ,
1581
1580
schema:: InheritableDependency :: Inherit ( w) => {
1582
- get_ws_inheritable ( & w ) . with_context ( || {
1581
+ w . inherit_with ( name , inheritable , cx ) . with_context ( || {
1583
1582
format ! (
1584
- "error inheriting `{label }` from workspace root manifest's `workspace.dependencies.{label }`" ,
1583
+ "error inheriting `{name }` from workspace root manifest's `workspace.dependencies.{name }`" ,
1585
1584
)
1586
1585
} )
1587
1586
}
0 commit comments