@@ -28,7 +28,7 @@ use crate::util::{
28
28
RustVersion ,
29
29
} ;
30
30
31
- pub mod embedded;
31
+ mod embedded;
32
32
pub mod schema;
33
33
mod targets;
34
34
use self :: targets:: targets;
@@ -1446,7 +1446,7 @@ fn inheritable_from_path(
1446
1446
}
1447
1447
1448
1448
/// Returns the name of the README file for a [`schema::TomlPackage`].
1449
- pub fn readme_for_package (
1449
+ fn readme_for_package (
1450
1450
package_root : & Path ,
1451
1451
readme : Option < & schema:: StringOrBool > ,
1452
1452
) -> Option < String > {
@@ -1505,7 +1505,7 @@ macro_rules! inheritable_field_getter {
1505
1505
( $( ( $key: literal, $field: ident -> $ret: ty) , ) * ) => (
1506
1506
$(
1507
1507
#[ doc = concat!( "Gets the field `workspace." , $key, "`." ) ]
1508
- pub fn $field( & self ) -> CargoResult <$ret> {
1508
+ fn $field( & self ) -> CargoResult <$ret> {
1509
1509
let Some ( val) = & self . $field else {
1510
1510
bail!( "`workspace.{}` was not defined" , $key) ;
1511
1511
} ;
@@ -1518,7 +1518,6 @@ macro_rules! inheritable_field_getter {
1518
1518
impl schema:: InheritableFields {
1519
1519
inheritable_field_getter ! {
1520
1520
// Please keep this list lexicographically ordered.
1521
- ( "dependencies" , dependencies -> BTreeMap <String , schema:: TomlDependency >) ,
1522
1521
( "lints" , lints -> schema:: TomlLints ) ,
1523
1522
( "package.authors" , authors -> Vec <String >) ,
1524
1523
( "package.badges" , badges -> BTreeMap <String , BTreeMap <String , String >>) ,
@@ -1538,7 +1537,7 @@ impl schema::InheritableFields {
1538
1537
}
1539
1538
1540
1539
/// Gets a workspace dependency with the `name`.
1541
- pub fn get_dependency (
1540
+ fn get_dependency (
1542
1541
& self ,
1543
1542
name : & str ,
1544
1543
package_root : & Path ,
@@ -1557,41 +1556,41 @@ impl schema::InheritableFields {
1557
1556
}
1558
1557
1559
1558
/// Gets the field `workspace.package.license-file`.
1560
- pub fn license_file ( & self , package_root : & Path ) -> CargoResult < String > {
1559
+ fn license_file ( & self , package_root : & Path ) -> CargoResult < String > {
1561
1560
let Some ( license_file) = & self . license_file else {
1562
1561
bail ! ( "`workspace.package.license-file` was not defined" ) ;
1563
1562
} ;
1564
1563
resolve_relative_path ( "license-file" , & self . ws_root , package_root, license_file)
1565
1564
}
1566
1565
1567
1566
/// Gets the field `workspace.package.readme`.
1568
- pub fn readme ( & self , package_root : & Path ) -> CargoResult < schema:: StringOrBool > {
1567
+ fn readme ( & self , package_root : & Path ) -> CargoResult < schema:: StringOrBool > {
1569
1568
let Some ( readme) = readme_for_package ( self . ws_root . as_path ( ) , self . readme . as_ref ( ) ) else {
1570
1569
bail ! ( "`workspace.package.readme` was not defined" ) ;
1571
1570
} ;
1572
1571
resolve_relative_path ( "readme" , & self . ws_root , package_root, & readme)
1573
1572
. map ( schema:: StringOrBool :: String )
1574
1573
}
1575
1574
1576
- pub fn ws_root ( & self ) -> & PathBuf {
1575
+ fn ws_root ( & self ) -> & PathBuf {
1577
1576
& self . ws_root
1578
1577
}
1579
1578
1580
- pub fn update_deps ( & mut self , deps : Option < BTreeMap < String , schema:: TomlDependency > > ) {
1579
+ fn update_deps ( & mut self , deps : Option < BTreeMap < String , schema:: TomlDependency > > ) {
1581
1580
self . dependencies = deps;
1582
1581
}
1583
1582
1584
- pub fn update_lints ( & mut self , lints : Option < schema:: TomlLints > ) {
1583
+ fn update_lints ( & mut self , lints : Option < schema:: TomlLints > ) {
1585
1584
self . lints = lints;
1586
1585
}
1587
1586
1588
- pub fn update_ws_path ( & mut self , ws_root : PathBuf ) {
1587
+ fn update_ws_path ( & mut self , ws_root : PathBuf ) {
1589
1588
self . ws_root = ws_root;
1590
1589
}
1591
1590
}
1592
1591
1593
1592
impl schema:: TomlPackage {
1594
- pub fn to_package_id ( & self , source_id : SourceId , version : semver:: Version ) -> PackageId {
1593
+ fn to_package_id ( & self , source_id : SourceId , version : semver:: Version ) -> PackageId {
1595
1594
PackageId :: pure ( self . name . as_str ( ) . into ( ) , version, source_id)
1596
1595
}
1597
1596
}
@@ -2084,7 +2083,7 @@ impl schema::TomlProfiles {
2084
2083
///
2085
2084
/// It's a bit unfortunate both `-Z` flags and `cargo-features` are required,
2086
2085
/// because profiles can now be set in either `Cargo.toml` or `config.toml`.
2087
- pub fn validate (
2086
+ fn validate (
2088
2087
& self ,
2089
2088
cli_unstable : & CliUnstable ,
2090
2089
features : & Features ,
0 commit comments