fix: ensure that ws loading error includes path to ws

This commit is contained in:
Alex Kladov 2023-06-19 12:32:04 +01:00
parent 00b9d9faf4
commit 49318bbae7
4 changed files with 30 additions and 2 deletions

View file

@ -31,6 +31,7 @@ pub mod target_data_layout;
mod tests;
use std::{
fmt,
fs::{self, read_dir, ReadDir},
io,
process::Command,
@ -145,6 +146,16 @@ impl ProjectManifest {
}
}
impl fmt::Display for ProjectManifest {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ProjectManifest::ProjectJson(it) | ProjectManifest::CargoToml(it) => {
fmt::Display::fmt(&it, f)
}
}
}
}
fn utf8_stdout(mut cmd: Command) -> Result<String> {
let output = cmd.output().with_context(|| format!("{cmd:?} failed"))?;
if !output.status.success() {