@@ -501,7 +501,7 @@ impl schema::TomlManifest {
501
501
let version = package
502
502
. version
503
503
. clone ( )
504
- . map ( |version| version. resolve ( "version" , || inherit ( ) ?. version ( ) ) )
504
+ . map ( |version| version. inherit_with ( "version" , || inherit ( ) ?. version ( ) ) )
505
505
. transpose ( ) ?;
506
506
507
507
package. version = version. clone ( ) . map ( schema:: InheritableField :: Value ) ;
@@ -515,7 +515,7 @@ impl schema::TomlManifest {
515
515
516
516
let edition = if let Some ( edition) = package. edition . clone ( ) {
517
517
let edition: Edition = edition
518
- . resolve ( "edition" , || inherit ( ) ?. edition ( ) ) ?
518
+ . inherit_with ( "edition" , || inherit ( ) ?. edition ( ) ) ?
519
519
. parse ( )
520
520
. with_context ( || "failed to parse the `edition` key" ) ?;
521
521
package. edition = Some ( schema:: InheritableField :: Value ( edition. to_string ( ) ) ) ;
@@ -542,7 +542,7 @@ impl schema::TomlManifest {
542
542
let rust_version = if let Some ( rust_version) = & package. rust_version {
543
543
let rust_version = rust_version
544
544
. clone ( )
545
- . resolve ( "rust_version" , || inherit ( ) ?. rust_version ( ) ) ?;
545
+ . inherit_with ( "rust_version" , || inherit ( ) ?. rust_version ( ) ) ?;
546
546
let req = rust_version. to_caret_req ( ) ;
547
547
if let Some ( first_version) = edition. first_version ( ) {
548
548
let unsupported =
@@ -661,7 +661,7 @@ impl schema::TomlManifest {
661
661
for ( n, v) in dependencies. iter ( ) {
662
662
let resolved = v
663
663
. clone ( )
664
- . resolve_with_self ( n, |dep| dep. resolve ( n, inheritable, cx) ) ?;
664
+ . inherit_with ( n, |dep| dep. inherit_with ( n, inheritable, cx) ) ?;
665
665
let dep = resolved. to_dependency ( n, cx, kind) ?;
666
666
let name_in_toml = dep. name_in_toml ( ) . as_str ( ) ;
667
667
validate_package_name ( name_in_toml, "dependency name" , "" ) ?;
@@ -718,7 +718,7 @@ impl schema::TomlManifest {
718
718
let lints = me
719
719
. lints
720
720
. clone ( )
721
- . map ( |mw| mw. resolve ( || inherit ( ) ?. lints ( ) ) )
721
+ . map ( |mw| mw. inherit_with ( || inherit ( ) ?. lints ( ) ) )
722
722
. transpose ( ) ?;
723
723
let lints = verify_lints ( lints) ?;
724
724
let default = schema:: TomlLints :: default ( ) ;
@@ -799,13 +799,13 @@ impl schema::TomlManifest {
799
799
let exclude = package
800
800
. exclude
801
801
. clone ( )
802
- . map ( |mw| mw. resolve ( "exclude" , || inherit ( ) ?. exclude ( ) ) )
802
+ . map ( |mw| mw. inherit_with ( "exclude" , || inherit ( ) ?. exclude ( ) ) )
803
803
. transpose ( ) ?
804
804
. unwrap_or_default ( ) ;
805
805
let include = package
806
806
. include
807
807
. clone ( )
808
- . map ( |mw| mw. resolve ( "include" , || inherit ( ) ?. include ( ) ) )
808
+ . map ( |mw| mw. inherit_with ( "include" , || inherit ( ) ?. include ( ) ) )
809
809
. transpose ( ) ?
810
810
. unwrap_or_default ( ) ;
811
811
let empty_features = BTreeMap :: new ( ) ;
@@ -832,70 +832,70 @@ impl schema::TomlManifest {
832
832
description : package
833
833
. description
834
834
. clone ( )
835
- . map ( |mw| mw. resolve ( "description" , || inherit ( ) ?. description ( ) ) )
835
+ . map ( |mw| mw. inherit_with ( "description" , || inherit ( ) ?. description ( ) ) )
836
836
. transpose ( ) ?,
837
837
homepage : package
838
838
. homepage
839
839
. clone ( )
840
- . map ( |mw| mw. resolve ( "homepage" , || inherit ( ) ?. homepage ( ) ) )
840
+ . map ( |mw| mw. inherit_with ( "homepage" , || inherit ( ) ?. homepage ( ) ) )
841
841
. transpose ( ) ?,
842
842
documentation : package
843
843
. documentation
844
844
. clone ( )
845
- . map ( |mw| mw. resolve ( "documentation" , || inherit ( ) ?. documentation ( ) ) )
845
+ . map ( |mw| mw. inherit_with ( "documentation" , || inherit ( ) ?. documentation ( ) ) )
846
846
. transpose ( ) ?,
847
847
readme : readme_for_package (
848
848
package_root,
849
849
package
850
850
. readme
851
851
. clone ( )
852
- . map ( |mw| mw. resolve ( "readme" , || inherit ( ) ?. readme ( package_root) ) )
852
+ . map ( |mw| mw. inherit_with ( "readme" , || inherit ( ) ?. readme ( package_root) ) )
853
853
. transpose ( ) ?
854
854
. as_ref ( ) ,
855
855
) ,
856
856
authors : package
857
857
. authors
858
858
. clone ( )
859
- . map ( |mw| mw. resolve ( "authors" , || inherit ( ) ?. authors ( ) ) )
859
+ . map ( |mw| mw. inherit_with ( "authors" , || inherit ( ) ?. authors ( ) ) )
860
860
. transpose ( ) ?
861
861
. unwrap_or_default ( ) ,
862
862
license : package
863
863
. license
864
864
. clone ( )
865
- . map ( |mw| mw. resolve ( "license" , || inherit ( ) ?. license ( ) ) )
865
+ . map ( |mw| mw. inherit_with ( "license" , || inherit ( ) ?. license ( ) ) )
866
866
. transpose ( ) ?,
867
867
license_file : package
868
868
. license_file
869
869
. clone ( )
870
- . map ( |mw| mw. resolve ( "license" , || inherit ( ) ?. license_file ( package_root) ) )
870
+ . map ( |mw| mw. inherit_with ( "license" , || inherit ( ) ?. license_file ( package_root) ) )
871
871
. transpose ( ) ?,
872
872
repository : package
873
873
. repository
874
874
. clone ( )
875
- . map ( |mw| mw. resolve ( "repository" , || inherit ( ) ?. repository ( ) ) )
875
+ . map ( |mw| mw. inherit_with ( "repository" , || inherit ( ) ?. repository ( ) ) )
876
876
. transpose ( ) ?,
877
877
keywords : package
878
878
. keywords
879
879
. clone ( )
880
- . map ( |mw| mw. resolve ( "keywords" , || inherit ( ) ?. keywords ( ) ) )
880
+ . map ( |mw| mw. inherit_with ( "keywords" , || inherit ( ) ?. keywords ( ) ) )
881
881
. transpose ( ) ?
882
882
. unwrap_or_default ( ) ,
883
883
categories : package
884
884
. categories
885
885
. clone ( )
886
- . map ( |mw| mw. resolve ( "categories" , || inherit ( ) ?. categories ( ) ) )
886
+ . map ( |mw| mw. inherit_with ( "categories" , || inherit ( ) ?. categories ( ) ) )
887
887
. transpose ( ) ?
888
888
. unwrap_or_default ( ) ,
889
889
badges : me
890
890
. badges
891
891
. clone ( )
892
- . map ( |mw| mw. resolve ( "badges" , || inherit ( ) ?. badges ( ) ) )
892
+ . map ( |mw| mw. inherit_with ( "badges" , || inherit ( ) ?. badges ( ) ) )
893
893
. transpose ( ) ?
894
894
. unwrap_or_default ( ) ,
895
895
links : package. links . clone ( ) ,
896
896
rust_version : package
897
897
. rust_version
898
- . map ( |mw| mw. resolve ( "rust-version" , || inherit ( ) ?. rust_version ( ) ) )
898
+ . map ( |mw| mw. inherit_with ( "rust-version" , || inherit ( ) ?. rust_version ( ) ) )
899
899
. transpose ( ) ?,
900
900
} ;
901
901
package. description = metadata
@@ -956,10 +956,11 @@ impl schema::TomlManifest {
956
956
profiles. validate ( cli_unstable, & features, & mut warnings) ?;
957
957
}
958
958
959
- let publish = package
960
- . publish
961
- . clone ( )
962
- . map ( |publish| publish. resolve ( "publish" , || inherit ( ) ?. publish ( ) ) . unwrap ( ) ) ;
959
+ let publish = package. publish . clone ( ) . map ( |publish| {
960
+ publish
961
+ . inherit_with ( "publish" , || inherit ( ) ?. publish ( ) )
962
+ . unwrap ( )
963
+ } ) ;
963
964
964
965
package. publish = publish. clone ( ) . map ( |p| schema:: InheritableField :: Value ( p) ) ;
965
966
@@ -1540,7 +1541,7 @@ impl schema::TomlPackage {
1540
1541
}
1541
1542
1542
1543
impl < T > schema:: InheritableField < T > {
1543
- fn resolve < ' a > (
1544
+ fn inherit_with < ' a > (
1544
1545
self ,
1545
1546
label : & str ,
1546
1547
get_ws_inheritable : impl FnOnce ( ) -> CargoResult < T > ,
@@ -1564,7 +1565,7 @@ impl<T> schema::InheritableField<T> {
1564
1565
}
1565
1566
1566
1567
impl schema:: InheritableDependency {
1567
- fn resolve_with_self < ' a > (
1568
+ fn inherit_with < ' a > (
1568
1569
self ,
1569
1570
label : & str ,
1570
1571
get_ws_inheritable : impl FnOnce ( & schema:: TomlInheritedDependency ) -> CargoResult < TomlDependency > ,
@@ -1583,7 +1584,7 @@ impl schema::InheritableDependency {
1583
1584
}
1584
1585
1585
1586
impl schema:: TomlInheritedDependency {
1586
- fn resolve < ' a > (
1587
+ fn inherit_with < ' a > (
1587
1588
& self ,
1588
1589
name : & str ,
1589
1590
inheritable : impl FnOnce ( ) -> CargoResult < & ' a schema:: InheritableFields > ,
@@ -2243,7 +2244,7 @@ impl schema::TomlProfile {
2243
2244
}
2244
2245
2245
2246
impl schema:: InheritableLints {
2246
- fn resolve < ' a > (
2247
+ fn inherit_with < ' a > (
2247
2248
self ,
2248
2249
get_ws_inheritable : impl FnOnce ( ) -> CargoResult < schema:: TomlLints > ,
2249
2250
) -> CargoResult < schema:: TomlLints > {
0 commit comments