removed useless Arc clone and spawn when not serialising

arg-parsing-better
Avril 3 years ago
parent c7b40396a2
commit f69ecbfcf1
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -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::<futures::future::BoxFuture<'static, ()>>::None))
}

Loading…
Cancel
Save