mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-09-29 10:13:29 +00:00
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.
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ use crate::{
|
|||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct CargoLocateProject<'a> {
|
struct CargoLocateProject<'a> {
|
||||||
#[serde(borrow)]
|
#[serde(borrow)]
|
||||||
root: &'a Path,
|
root: &'a str,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init() -> Result<()> {
|
pub fn init() -> Result<()> {
|
||||||
@@ -74,7 +74,7 @@ pub fn init() -> Result<()> {
|
|||||||
.root;
|
.root;
|
||||||
|
|
||||||
let workspace_manifest_content = fs::read_to_string(workspace_manifest)
|
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]")
|
if !workspace_manifest_content.contains("[workspace]")
|
||||||
&& !workspace_manifest_content.contains("workspace.")
|
&& !workspace_manifest_content.contains("workspace.")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user