Skip to content

Commit 13cc3ac

Browse files
committed
Improve readability
1 parent 5b7368c commit 13cc3ac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/cmd.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ impl CmdRunner {
7474
bail!("The command `cargo metadata …` failed. Are you in the `rustlings/` directory?");
7575
}
7676

77-
let target_dir = serde_json::de::from_slice::<CargoMetadata>(&metadata_output.stdout)
77+
let metadata: CargoMetadata = serde_json::de::from_slice(&metadata_output.stdout)
7878
.context(
7979
"Failed to read the field `target_directory` from the output of the command `cargo metadata …`",
80-
)?.target_directory;
80+
)?;
8181

82-
Ok(Self { target_dir })
82+
Ok(Self {
83+
target_dir: metadata.target_directory,
84+
})
8385
}
8486

8587
pub fn cargo<'out>(

0 commit comments

Comments
 (0)