refactor(embedded): Move workspace to normalization

This commit is contained in:
Ed Page 2025-02-07 11:05:30 -06:00
parent 3582b788cd
commit dffd0fd4c7
2 changed files with 4 additions and 8 deletions

View File

@ -84,9 +84,6 @@ fn expand_manifest_(manifest: &str, path: &std::path::Path) -> CargoResult<toml:
}
}
// Prevent looking for a workspace by `read_manifest_from_str`
manifest.insert("workspace".to_owned(), toml::Table::new().into());
if let Some(package) = manifest.get("package").and_then(|v| v.as_table()) {
for key in ["workspace", "build", "links"]
.iter()
@ -539,8 +536,6 @@ fn main() {}
name = "test-"
path = "/home/me/test.rs"
[workspace]
"#]]
);
}
@ -564,8 +559,6 @@ path = [..]
[dependencies]
time = "0.1.25"
[workspace]
"#]]
);
}

View File

@ -308,7 +308,10 @@ fn normalize_toml(
build_dependencies2: None,
target: None,
lints: None,
workspace: original_toml.workspace.clone(),
workspace: original_toml.workspace.clone().or_else(|| {
// Prevent looking for a workspace by `read_manifest_from_str`
is_embedded.then(manifest::TomlWorkspace::default)
}),
profile: original_toml.profile.clone(),
patch: normalize_patch(
gctx,