Skip to content

Commit

Permalink
Xsync the whole workspace package table (#678)
Browse files Browse the repository at this point in the history
Now that edition is there too.
  • Loading branch information
smalis-msft authored Jan 16, 2025
1 parent 46ce393 commit b6f9509
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions xsync/xsync/src/tasks/cargo_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ impl Cmd for CargoToml {
let self::custom_meta::Inherit {
profile,
patch,
workspace:
self::custom_meta::InheritWorkspace {
lints,
rust_version,
},
workspace: self::custom_meta::InheritWorkspace { lints, package },
} = meta.inherit;

if profile {
Expand All @@ -76,7 +72,7 @@ impl Cmd for CargoToml {
cargo_toml.patch = base_cargo_toml.patch.clone();
}

if rust_version {
if package {
if cargo_toml.workspace.as_mut().unwrap().package.is_none() {
cargo_toml.workspace.as_mut().unwrap().package =
Some(PackageTemplate::default());
Expand All @@ -88,18 +84,16 @@ impl Cmd for CargoToml {
.unwrap()
.package
.as_mut()
.unwrap()
.rust_version)
.clone_from(
&base_cargo_toml
.workspace
.as_ref()
.unwrap()
.package
.as_ref()
.unwrap()
.rust_version,
);
.unwrap())
.clone_from(
&base_cargo_toml
.workspace
.as_ref()
.unwrap()
.package
.as_ref()
.unwrap(),
);
}

if lints {
Expand Down Expand Up @@ -188,6 +182,6 @@ mod custom_meta {
#[derive(Debug, Serialize, Deserialize)]
pub struct InheritWorkspace {
pub lints: bool,
pub rust_version: bool,
pub package: bool,
}
}

0 comments on commit b6f9509

Please sign in to comment.