diff options
| author | mo8it <mo8it@proton.me> | 2024-08-20 13:56:52 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-08-20 13:56:52 +0200 |
| commit | 13cc3acdfdcff91c059f4153c694464750a67b82 (patch) | |
| tree | 1c3ef4312e409bf1ae9b6554a35df7616e905754 /src/cmd.rs | |
| parent | 5b7368c46d9369a58075000b03be7f171f230f5c (diff) | |
Improve readability
Diffstat (limited to 'src/cmd.rs')
| -rw-r--r-- | src/cmd.rs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -74,12 +74,14 @@ impl CmdRunner { 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( "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>( |
