@@ -661,9 +661,7 @@ impl schema::TomlManifest {
661661
662662 let mut deps: BTreeMap < String , schema:: InheritableDependency > = BTreeMap :: new ( ) ;
663663 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) ?;
667665 let dep = resolved. to_dependency ( n, cx, kind) ?;
668666 let name_in_toml = dep. name_in_toml ( ) . as_str ( ) ;
669667 validate_package_name ( name_in_toml, "dependency name" , "" ) ?;
@@ -1573,15 +1571,16 @@ impl<T> schema::InheritableField<T> {
15731571impl schema:: InheritableDependency {
15741572 fn inherit_with < ' a > (
15751573 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 < ' _ , ' _ > ,
15781577 ) -> CargoResult < TomlDependency > {
15791578 match self {
15801579 schema:: InheritableDependency :: Value ( value) => Ok ( value) ,
15811580 schema:: InheritableDependency :: Inherit ( w) => {
1582- get_ws_inheritable ( & w ) . with_context ( || {
1581+ w . inherit_with ( name , inheritable , cx ) . with_context ( || {
15831582 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 }`" ,
15851584 )
15861585 } )
15871586 }
0 commit comments