Skip to content

Commit 512ce78

Browse files
committed
fix(toml): Prevent workspace=false in API
1 parent 9765a44 commit 512ce78

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/cargo/util/toml/schema.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,19 @@ impl<'de> de::Deserialize<'de> for InheritableBtreeMap {
411411
#[serde(rename_all = "kebab-case")]
412412
pub struct TomlInheritedField {
413413
#[serde(deserialize_with = "bool_no_false")]
414-
pub workspace: bool,
414+
workspace: bool,
415+
}
416+
417+
impl TomlInheritedField {
418+
pub fn new() -> Self {
419+
TomlInheritedField { workspace: true }
420+
}
421+
}
422+
423+
impl Default for TomlInheritedField {
424+
fn default() -> Self {
425+
Self::new()
426+
}
415427
}
416428

417429
fn bool_no_false<'de, D: de::Deserializer<'de>>(deserializer: D) -> Result<bool, D::Error> {

0 commit comments

Comments
 (0)