Skip to content

Commit 71f8173

Browse files
committed
fix: emit_serialized_unit_graph uses the configured shell
1 parent 94d274d commit 71f8173

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/cargo/core/compiler/unit_graph.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::util::interning::InternedString;
1010
use crate::util::CargoResult;
1111
use crate::GlobalContext;
1212
use std::collections::HashMap;
13-
use std::io::Write;
1413

1514
/// The dependency graph of Units.
1615
pub type UnitGraph = HashMap<Unit, Vec<UnitDep>>;
@@ -121,15 +120,10 @@ pub fn emit_serialized_unit_graph(
121120
}
122121
})
123122
.collect();
124-
let s = SerializedUnitGraph {
123+
124+
gctx.shell().print_json(&SerializedUnitGraph {
125125
version: VERSION,
126126
units: ser_units,
127127
roots,
128-
};
129-
130-
let stdout = std::io::stdout();
131-
let mut lock = stdout.lock();
132-
serde_json::to_writer(&mut lock, &s)?;
133-
drop(writeln!(lock));
134-
Ok(())
128+
})
135129
}

0 commit comments

Comments
 (0)