about summary refs log tree commit diff
path: root/tvix/cli/src
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-09T10·16+0300
committertazjin <tazjin@tvl.su>2022-12-21T13·23+0000
commit6d3d2379233109d3d8b122b7dfe80dd4f4557d2e (patch)
treeb24801fc1c26bc873f67ffdbcb14fd7fcd6efb87 /tvix/cli/src
parent59e695a9d907aba0db23fb6ac71acd80f7713cd0 (diff)
refactor(tvix/eval): consume `self` in Evaluation::evaluate r/5445
This simplifies lifetime management for observers in callers of tvix_eval.

Change-Id: I2f47c8d89f22b1c766526e5d1483c0d026b500ae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7546
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/cli/src')
-rw-r--r--tvix/cli/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs
index 1c148cad3873..75142d620c6d 100644
--- a/tvix/cli/src/main.rs
+++ b/tvix/cli/src/main.rs
@@ -20,10 +20,10 @@ struct Args {
 /// and the result itself. The return value indicates whether
 /// evaluation succeeded.
 fn interpret(code: &str, path: Option<PathBuf>) -> bool {
-    let mut eval = tvix_eval::Evaluation::new(code, path);
+    let eval = tvix_eval::Evaluation::new(code, path);
+    let source_map = eval.source_map();
     let result = eval.evaluate();
 
-    let source_map = eval.source_map();
     for error in &result.errors {
         error.fancy_format_stderr(&source_map);
     }