diff --git a/src/engine/dag.rs b/src/engine/dag.rs index 810de8b..1b6a176 100644 --- a/src/engine/dag.rs +++ b/src/engine/dag.rs @@ -216,11 +216,16 @@ impl Dag { /// topological sorting, and cancel the execution of subsequent tasks if an /// error is encountered during task execution. pub(crate) async fn run(&self) -> bool { - let mut exe_seq = String::from("[Start]"); - self.exe_sequence - .iter() - .for_each(|id| exe_seq.push_str(&format!(" -> {}", self.tasks[id].name()))); - info!("{} -> [End]", exe_seq); + info!( + "[Start]{} -> [End]", + (|| { + let mut exe_seq = String::new(); + self.exe_sequence + .iter() + .for_each(|id| exe_seq.push_str(&format!(" -> {}", self.tasks[id].name()))); + exe_seq + })() + ); let mut handles = Vec::new(); self.exe_sequence.iter().for_each(|id| { handles.push((*id, self.execute_task(&self.tasks[id])));