From 6d3d2379233109d3d8b122b7dfe80dd4f4557d2e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 9 Dec 2022 13:16:01 +0300 Subject: refactor(tvix/eval): consume `self` in Evaluation::evaluate 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 Reviewed-by: grfn Tested-by: BuildkiteCI --- tvix/cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/cli') 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) -> 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); } -- cgit 1.4.1