mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 15:26:29 +00:00
Improve readability
This commit is contained in:
parent
5b7368c46d
commit
13cc3acdfd
1 changed files with 5 additions and 3 deletions
|
@ -74,12 +74,14 @@ impl CmdRunner {
|
||||||
bail!("The command `cargo metadata …` failed. Are you in the `rustlings/` directory?");
|
bail!("The command `cargo metadata …` failed. Are you in the `rustlings/` directory?");
|
||||||
}
|
}
|
||||||
|
|
||||||
let target_dir = serde_json::de::from_slice::<CargoMetadata>(&metadata_output.stdout)
|
let metadata: CargoMetadata = serde_json::de::from_slice(&metadata_output.stdout)
|
||||||
.context(
|
.context(
|
||||||
"Failed to read the field `target_directory` from the output of the command `cargo metadata …`",
|
"Failed to read the field `target_directory` from the output of the command `cargo metadata …`",
|
||||||
)?.target_directory;
|
)?;
|
||||||
|
|
||||||
Ok(Self { target_dir })
|
Ok(Self {
|
||||||
|
target_dir: metadata.target_directory,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cargo<'out>(
|
pub fn cargo<'out>(
|
||||||
|
|
Loading…
Reference in a new issue