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 --- tvix/serde/src/de.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/serde/src') diff --git a/tvix/serde/src/de.rs b/tvix/serde/src/de.rs index 2e8a9618e637..500c9c98409d 100644 --- a/tvix/serde/src/de.rs +++ b/tvix/serde/src/de.rs @@ -46,12 +46,12 @@ where F: FnOnce(&mut Evaluation), { // First step is to evaluate the Nix code ... - let mut eval = Evaluation::new(src, None); + let mut eval = Evaluation::default(); config(&mut eval); eval.strict = true; let source = eval.source_map(); - let result = eval.evaluate(); + let result = eval.evaluate(src, None); if !result.errors.is_empty() { return Err(Error::NixErrors { -- cgit 1.4.1