diff --git a/src/main.rs b/src/main.rs index b28fefc..e916f03 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,7 +139,12 @@ async fn normal(cfg: config::Config) -> eyre::Result<()> cfg_if!{ if #[cfg(feature="inspect")] { let graph = Arc::new(graph); - (Arc::clone(&graph), OptionFuture::from(Some(tokio::spawn(write_graph(graph))))) + let (g, w) = if cfg.serialise_output.is_some() { + (Arc::clone(&graph), Some(tokio::spawn(write_graph(graph)))) + } else { + (graph, None) + }; + (g, OptionFuture::from(w)) } else { (graph, OptionFuture::from(Option::>::None)) }