From 4fba57c2c90f2e7b02da9187e59f8d64deef3fb2 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 30 Dec 2023 21:36:48 +0100 Subject: refactor(tvix/eval): remove code and location from struct Instead, it's passed in the evaluate/compile_only functions, which feels more naturally. It lets us set up the Evaluation struct long before we actually feed it with data to evaluate. Now that Evaluation::new() would be accepting an empty list of arguments, we can simply implement Default, making things a bit more idiomatic. Change-Id: I4369658634909a0c504fdffa18242a130daa0239 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10475 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: flokli --- corp/tvixbolt/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'corp') diff --git a/corp/tvixbolt/src/main.rs b/corp/tvixbolt/src/main.rs index 0de48b3ac7..5a4f250881 100644 --- a/corp/tvixbolt/src/main.rs +++ b/corp/tvixbolt/src/main.rs @@ -286,7 +286,7 @@ fn eval(model: &Model) -> Output { return out; } - let mut eval = tvix_eval::Evaluation::new(&model.code, Some("/nixbolt".into())); + let mut eval = tvix_eval::Evaluation::default(); let source = eval.source_map(); let result = { @@ -298,7 +298,7 @@ fn eval(model: &Model) -> Output { eval.runtime_observer = Some(&mut runtime_observer); } - eval.evaluate() + eval.evaluate(&model.code, Some("/nixbolt".into())) }; if model.display_ast { -- cgit 1.4.1