@@ -1530,25 +1530,23 @@ fn unique_build_targets(
1530
1530
}
1531
1531
1532
1532
#[ derive( Debug , Deserialize , Serialize , Clone ) ]
1533
+ #[ serde( rename_all = "kebab-case" ) ]
1533
1534
pub struct TomlWorkspace {
1534
1535
members : Option < Vec < String > > ,
1535
- #[ serde( rename = "default-members" ) ]
1536
- default_members : Option < Vec < String > > ,
1537
1536
exclude : Option < Vec < String > > ,
1537
+ default_members : Option < Vec < String > > ,
1538
1538
resolver : Option < String > ,
1539
+ metadata : Option < toml:: Value > ,
1539
1540
1540
1541
// Properties that can be inherited by members.
1541
1542
package : Option < InheritableFields > ,
1542
1543
dependencies : Option < BTreeMap < String , TomlDependency > > ,
1543
1544
lints : Option < TomlLints > ,
1544
-
1545
- // Note that this field must come last due to the way toml serialization
1546
- // works which requires tables to be emitted after all values.
1547
- metadata : Option < toml:: Value > ,
1548
1545
}
1549
1546
1550
1547
/// A group of fields that are inheritable by members of the workspace
1551
1548
#[ derive( Clone , Debug , Default , Deserialize , Serialize ) ]
1549
+ #[ serde( rename_all = "kebab-case" ) ]
1552
1550
pub struct InheritableFields {
1553
1551
// We use skip here since it will never be present when deserializing
1554
1552
// and we don't want it present when serializing
@@ -1566,15 +1564,13 @@ pub struct InheritableFields {
1566
1564
keywords : Option < Vec < String > > ,
1567
1565
categories : Option < Vec < String > > ,
1568
1566
license : Option < String > ,
1569
- #[ serde( rename = "license-file" ) ]
1570
1567
license_file : Option < String > ,
1571
1568
repository : Option < String > ,
1572
1569
publish : Option < VecStringOrBool > ,
1573
1570
edition : Option < String > ,
1574
1571
badges : Option < BTreeMap < String , BTreeMap < String , String > > > ,
1575
1572
exclude : Option < Vec < String > > ,
1576
1573
include : Option < Vec < String > > ,
1577
- #[ serde( rename = "rust-version" ) ]
1578
1574
rust_version : Option < RustVersion > ,
1579
1575
// We use skip here since it will never be present when deserializing
1580
1576
// and we don't want it present when serializing
@@ -1710,13 +1706,11 @@ pub struct TomlPackage {
1710
1706
repository : Option < MaybeWorkspaceString > ,
1711
1707
resolver : Option < String > ,
1712
1708
1713
- // Provide a helpful error message for a common user error.
1709
+ metadata : Option < toml:: Value > ,
1710
+
1711
+ /// Provide a helpful error message for a common user error.
1714
1712
#[ serde( rename = "cargo-features" , skip_serializing) ]
1715
1713
_invalid_cargo_features : Option < InvalidCargoFeatures > ,
1716
-
1717
- // Note that this field must come last due to the way toml serialization
1718
- // works which requires tables to be emitted after all values.
1719
- metadata : Option < toml:: Value > ,
1720
1714
}
1721
1715
1722
1716
impl TomlPackage {
@@ -2034,6 +2028,7 @@ impl<'de> de::Deserialize<'de> for MaybeWorkspaceBtreeMap {
2034
2028
}
2035
2029
2036
2030
#[ derive( Deserialize , Serialize , Copy , Clone , Debug ) ]
2031
+ #[ serde( rename_all = "kebab-case" ) ]
2037
2032
pub struct TomlWorkspaceField {
2038
2033
#[ serde( deserialize_with = "bool_no_false" ) ]
2039
2034
workspace : bool ,
@@ -2064,7 +2059,7 @@ impl MaybeWorkspaceDependency {
2064
2059
fn unused_keys ( & self ) -> Vec < String > {
2065
2060
match self {
2066
2061
MaybeWorkspaceDependency :: Defined ( d) => d. unused_keys ( ) ,
2067
- MaybeWorkspaceDependency :: Workspace ( w) => w. other . keys ( ) . cloned ( ) . collect ( ) ,
2062
+ MaybeWorkspaceDependency :: Workspace ( w) => w. unused_keys . keys ( ) . cloned ( ) . collect ( ) ,
2068
2063
}
2069
2064
}
2070
2065
}
@@ -2101,10 +2096,11 @@ pub struct TomlWorkspaceDependency {
2101
2096
default_features2 : Option < bool > ,
2102
2097
optional : Option < bool > ,
2103
2098
public : Option < bool > ,
2099
+
2104
2100
/// This is here to provide a way to see the "unused manifest keys" when deserializing
2105
2101
#[ serde( skip_serializing) ]
2106
2102
#[ serde( flatten) ]
2107
- other : BTreeMap < String , toml:: Value > ,
2103
+ unused_keys : BTreeMap < String , toml:: Value > ,
2108
2104
}
2109
2105
2110
2106
impl TomlWorkspaceDependency {
@@ -2212,7 +2208,7 @@ impl TomlDependency {
2212
2208
fn unused_keys ( & self ) -> Vec < String > {
2213
2209
match self {
2214
2210
TomlDependency :: Simple ( _) => vec ! [ ] ,
2215
- TomlDependency :: Detailed ( detailed) => detailed. other . keys ( ) . cloned ( ) . collect ( ) ,
2211
+ TomlDependency :: Detailed ( detailed) => detailed. unused_keys . keys ( ) . cloned ( ) . collect ( ) ,
2216
2212
}
2217
2213
}
2218
2214
}
@@ -2326,10 +2322,11 @@ pub struct DetailedTomlDependency<P: Clone = String> {
2326
2322
lib : Option < bool > ,
2327
2323
/// A platform name, like `x86_64-apple-darwin`
2328
2324
target : Option < String > ,
2325
+
2329
2326
/// This is here to provide a way to see the "unused manifest keys" when deserializing
2330
2327
#[ serde( skip_serializing) ]
2331
2328
#[ serde( flatten) ]
2332
- other : BTreeMap < String , toml:: Value > ,
2329
+ unused_keys : BTreeMap < String , toml:: Value > ,
2333
2330
}
2334
2331
2335
2332
impl DetailedTomlDependency {
@@ -2635,7 +2632,7 @@ impl<P: Clone> Default for DetailedTomlDependency<P> {
2635
2632
artifact : Default :: default ( ) ,
2636
2633
lib : Default :: default ( ) ,
2637
2634
target : Default :: default ( ) ,
2638
- other : Default :: default ( ) ,
2635
+ unused_keys : Default :: default ( ) ,
2639
2636
}
2640
2637
}
2641
2638
}
@@ -3383,20 +3380,20 @@ impl TomlTarget {
3383
3380
3384
3381
/// Corresponds to a `target` entry, but `TomlTarget` is already used.
3385
3382
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
3383
+ #[ serde( rename_all = "kebab-case" ) ]
3386
3384
struct TomlPlatform {
3387
3385
dependencies : Option < BTreeMap < String , MaybeWorkspaceDependency > > ,
3388
- #[ serde( rename = "build-dependencies" ) ]
3389
3386
build_dependencies : Option < BTreeMap < String , MaybeWorkspaceDependency > > ,
3390
3387
#[ serde( rename = "build_dependencies" ) ]
3391
3388
build_dependencies2 : Option < BTreeMap < String , MaybeWorkspaceDependency > > ,
3392
- #[ serde( rename = "dev-dependencies" ) ]
3393
3389
dev_dependencies : Option < BTreeMap < String , MaybeWorkspaceDependency > > ,
3394
3390
#[ serde( rename = "dev_dependencies" ) ]
3395
3391
dev_dependencies2 : Option < BTreeMap < String , MaybeWorkspaceDependency > > ,
3396
3392
}
3397
3393
3398
3394
#[ derive( Deserialize , Serialize , Debug , Clone ) ]
3399
3395
#[ serde( expecting = "a lints table" ) ]
3396
+ #[ serde( rename_all = "kebab-case" ) ]
3400
3397
pub struct MaybeWorkspaceLints {
3401
3398
#[ serde( skip_serializing_if = "is_false" ) ]
3402
3399
#[ serde( deserialize_with = "bool_no_false" , default ) ]
0 commit comments