Skip to content

Commit 929112a

Browse files
tuguzTLegNeato
authored andcommitted
Fix CargoCmd to implement Debug & be convertible into regular Command
1 parent dfcff49 commit 929112a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/spirv-builder/src/cargo_cmd.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::HashSet;
22
use std::env;
33
use std::ffi::{OsStr, OsString};
4-
use std::fmt::{Display, Formatter};
4+
use std::fmt::{Debug, Display, Formatter};
55
use std::ops::{Deref, DerefMut};
66
use std::process::Command;
77

@@ -107,7 +107,7 @@ impl Default for CargoCmd {
107107
}
108108
}
109109

110-
impl Display for CargoCmd {
110+
impl Debug for CargoCmd {
111111
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
112112
f.debug_struct("CargoCmd")
113113
.field("cargo", &self.cargo)
@@ -116,6 +116,12 @@ impl Display for CargoCmd {
116116
}
117117
}
118118

119+
impl From<CargoCmd> for Command {
120+
fn from(cmd: CargoCmd) -> Self {
121+
cmd.cargo
122+
}
123+
}
124+
119125
impl Deref for CargoCmd {
120126
type Target = Command;
121127

crates/spirv-builder/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
10591059
);
10601060

10611061
cargo.stderr(Stdio::inherit()).current_dir(path_to_crate);
1062-
log::debug!("building shaders with `{cargo}`");
1062+
log::debug!("building shaders with `{cargo:?}`");
10631063
let build = cargo.output().expect("failed to execute cargo build");
10641064

10651065
// `get_last_artifact` has the side-effect of printing invalid lines, so

0 commit comments

Comments
 (0)