From f816813d41271043473f8740bbc8c257f9b54982 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 23 Sep 2022 03:14:34 +0300 Subject: feat(tvix/eval): implement 'builtins.filter' This is a little ugly because the plain Iterator::filter method can not be used (it does not support fallible primitives), so we need to resort to an `Iterator::filter_map` and deal with the wrapping in Options everywhere. This prevents use of `?` which introduces the need for some matching, but it's not *too* bad. Change-Id: Ie2c3c0c9756c4c627176f64fb4e0054e717c26d1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6765 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/vm.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tvix/eval/src/vm.rs') diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs index d6a24ebf86..547772b0fe 100644 --- a/tvix/eval/src/vm.rs +++ b/tvix/eval/src/vm.rs @@ -175,7 +175,7 @@ impl<'o> VM<'o> { /// Construct an error from the given ErrorKind and the source /// span of the current instruction. - fn error(&self, kind: ErrorKind) -> Error { + pub fn error(&self, kind: ErrorKind) -> Error { Error { kind, span: self.current_span(), -- cgit 1.4.1