about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-09T13·51+0300
committertazjin <tazjin@tvl.su>2022-08-13T11·50+0000
commit865717a8dbef9f89f2c32d0c86d970f3c21dbd9f (patch)
treeda4096262810a2b1a0ac9280c25200fc17c301bf
parent2ed38a7cdbd248deb518afff790977243f169a8f (diff)
fix(tvix/eval): print code even if runtime fails r/4424
Change-Id: I357c9adf939cb6001afa73ad02282d94ee22d0ba
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6088
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
-rw-r--r--tvix/eval/src/eval.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index 9d3f993ba2..04aa939528 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -1,5 +1,4 @@
 use rnix::{self, types::TypedNode};
-use std::fmt::Write;
 
 use crate::errors::EvalResult;
 
@@ -11,14 +10,11 @@ pub fn interpret(code: String) -> EvalResult<String> {
         todo!()
     }
 
-    let mut out = String::new();
     println!("{}", ast.root().dump());
 
     let code = crate::compiler::compile(ast)?;
-    writeln!(out, "code: {:?}", code).ok();
+    println!("code: {:?}", code);
 
     let value = crate::vm::run_chunk(code)?;
-    writeln!(out, "value: {:?}", value).ok();
-
-    Ok(out)
+    Ok(format!("value: {:?}", value))
 }