From 31cdcf1366e14e739f133d5b9afa0e23580d834c Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Sat, 6 Apr 2024 11:23:54 +0200 Subject: [PATCH] Do not add implicitly gathered information when modifying Cargo.toml --- wasm-rpc-stubgen/src/cargo.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wasm-rpc-stubgen/src/cargo.rs b/wasm-rpc-stubgen/src/cargo.rs index a22a97ff..038fb91d 100644 --- a/wasm-rpc-stubgen/src/cargo.rs +++ b/wasm-rpc-stubgen/src/cargo.rs @@ -232,7 +232,9 @@ pub fn add_workspace_members(path: &Path, members: &[String]) -> anyhow::Result< } pub fn add_dependencies_to_cargo_toml(cargo_path: &Path, names: &[String]) -> anyhow::Result<()> { - let mut manifest: Manifest = Manifest::from_path_with_metadata(cargo_path)?; + let raw_manifest = std::fs::read_to_string(cargo_path)?; + let mut manifest: Manifest = + Manifest::from_slice_with_metadata(raw_manifest.as_bytes())?; if let Some(ref mut package) = manifest.package { if let Some(ref mut metadata) = package.metadata { if let Some(ref mut component) = metadata.component {