From 359ece4d279dae27c79c0f2f57566a6754557260 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Mon, 21 Sep 2026 15:46:38 +0200 Subject: [PATCH] fix parsing of cargo locate-project output Deserializing the output of `cargo locate-project --workspace` failed for a windows user, with the error message from serde that `root` is a string and not a path. Hopefully, using a string directly will also work on Windows. --- src/init.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.rs b/src/init.rs index 3ccef756..cc6d8552 100644 --- a/src/init.rs +++ b/src/init.rs @@ -20,7 +20,7 @@ use crate::{ #[derive(Deserialize)] struct CargoLocateProject<'a> { #[serde(borrow)] - root: &'a Path, + root: &'a str, } pub fn init() -> Result<()> { @@ -74,7 +74,7 @@ pub fn init() -> Result<()> { .root; let workspace_manifest_content = fs::read_to_string(workspace_manifest) - .with_context(|| format!("Failed to read the file {}", workspace_manifest.display()))?; + .with_context(|| format!("Failed to read the file {}", workspace_manifest))?; if !workspace_manifest_content.contains("[workspace]") && !workspace_manifest_content.contains("workspace.") {