From f22f089b9b1202d2182e5a44f00852e7cf32fd4b Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 29 Apr 2018 04:00:41 -0700 Subject: [PATCH] finish method on UnfinishedComputation --- schala-repl/src/language.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/schala-repl/src/language.rs b/schala-repl/src/language.rs index ecb218f..5a55334 100644 --- a/schala-repl/src/language.rs +++ b/schala-repl/src/language.rs @@ -82,6 +82,12 @@ impl UnfinishedComputation { pub fn add_artifact(&mut self, artifact: TraceArtifact) { self.artifacts.insert(artifact.stage_name.clone(), artifact); } + pub fn finish(self, text_output: Result) -> FinishedComputation { + FinishedComputation { + artifacts: self.artifacts, + text_output + } + } pub fn output(self, output: Result) -> FinishedComputation { FinishedComputation { artifacts: self.artifacts, @@ -209,7 +215,7 @@ macro_rules! pass_chain_helper { ($state:expr, $final_output:expr) => { { let comp = UnfinishedComputation::default(); - let final_output: FinishedComputation = comp.output(Ok(format!("{:?}", $final_output))); + let final_output: FinishedComputation = comp.finish(Ok($final_output)); final_output } };