@@ -1632,18 +1632,6 @@ impl InheritableFields {
1632
1632
( "package.version" , version -> semver:: Version ) ,
1633
1633
}
1634
1634
1635
- pub fn update_deps ( & mut self , deps : Option < BTreeMap < String , TomlDependency > > ) {
1636
- self . dependencies = deps;
1637
- }
1638
-
1639
- pub fn update_lints ( & mut self , lints : Option < TomlLints > ) {
1640
- self . lints = lints;
1641
- }
1642
-
1643
- pub fn update_ws_path ( & mut self , ws_root : PathBuf ) {
1644
- self . ws_root = ws_root;
1645
- }
1646
-
1647
1635
/// Gets a workspace dependency with the `name`.
1648
1636
pub fn get_dependency ( & self , name : & str , package_root : & Path ) -> CargoResult < TomlDependency > {
1649
1637
let Some ( deps) = & self . dependencies else {
@@ -1659,6 +1647,14 @@ impl InheritableFields {
1659
1647
Ok ( dep)
1660
1648
}
1661
1649
1650
+ /// Gets the field `workspace.package.license-file`.
1651
+ pub fn license_file ( & self , package_root : & Path ) -> CargoResult < String > {
1652
+ let Some ( license_file) = & self . license_file else {
1653
+ bail ! ( "`workspace.package.license-file` was not defined" ) ;
1654
+ } ;
1655
+ resolve_relative_path ( "license-file" , & self . ws_root , package_root, license_file)
1656
+ }
1657
+
1662
1658
/// Gets the field `workspace.package.readme`.
1663
1659
pub fn readme ( & self , package_root : & Path ) -> CargoResult < StringOrBool > {
1664
1660
let Some ( readme) = readme_for_package ( self . ws_root . as_path ( ) , self . readme . as_ref ( ) ) else {
@@ -1668,17 +1664,21 @@ impl InheritableFields {
1668
1664
. map ( StringOrBool :: String )
1669
1665
}
1670
1666
1671
- /// Gets the field `workspace.package.license-file`.
1672
- pub fn license_file ( & self , package_root : & Path ) -> CargoResult < String > {
1673
- let Some ( license_file) = & self . license_file else {
1674
- bail ! ( "`workspace.package.license-file` was not defined" ) ;
1675
- } ;
1676
- resolve_relative_path ( "license-file" , & self . ws_root , package_root, license_file)
1677
- }
1678
-
1679
1667
pub fn ws_root ( & self ) -> & PathBuf {
1680
1668
& self . ws_root
1681
1669
}
1670
+
1671
+ pub fn update_deps ( & mut self , deps : Option < BTreeMap < String , TomlDependency > > ) {
1672
+ self . dependencies = deps;
1673
+ }
1674
+
1675
+ pub fn update_lints ( & mut self , lints : Option < TomlLints > ) {
1676
+ self . lints = lints;
1677
+ }
1678
+
1679
+ pub fn update_ws_path ( & mut self , ws_root : PathBuf ) {
1680
+ self . ws_root = ws_root;
1681
+ }
1682
1682
}
1683
1683
1684
1684
impl TomlPackage {
0 commit comments