Skip to content

Commit e08cb8d

Browse files
committed
replace read-manifest by metadata and no longer remove workspace table
1 parent aad9f36 commit e08cb8d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/prepare.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'a> Prepare<'a> {
5959
}
6060

6161
let res = Command::new(self.workspace, self.toolchain.cargo())
62-
.args(&["read-manifest", "--manifest-path", "Cargo.toml"])
62+
.args(&["metadata", "--manifest-path", "Cargo.toml", "--no-deps"])
6363
.cd(self.source_dir)
6464
.log_output(false)
6565
.run();
@@ -196,7 +196,7 @@ impl<'a> TomlTweaker<'a> {
196196

197197
self.remove_missing_items("example");
198198
self.remove_missing_items("test");
199-
self.remove_workspaces();
199+
self.remove_parent_workspaces();
200200
self.remove_unwanted_cargo_features();
201201
self.remove_dependencies();
202202
self.apply_patches();
@@ -237,13 +237,9 @@ impl<'a> TomlTweaker<'a> {
237237
}
238238
}
239239

240-
fn remove_workspaces(&mut self) {
240+
fn remove_parent_workspaces(&mut self) {
241241
let krate = self.krate.to_string();
242242

243-
if self.table.remove("workspace").is_some() {
244-
info!("removed workspace from {}", krate);
245-
}
246-
247243
// Eliminate parent workspaces
248244
if let Some(&mut Value::Table(ref mut package)) = self.table.get_mut("package") {
249245
if package.remove("workspace").is_some() {
@@ -467,6 +463,9 @@ mod tests {
467463

468464
[target."cfg(unix)".dependencies]
469465
quux = { version = "1.0" }
466+
467+
[workspace]
468+
members = []
470469
};
471470

472471
let krate = Crate::local("/dev/null".as_ref());

0 commit comments

Comments
 (0)