about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-26T15·40+0300
committertazjin <tazjin@tvl.su>2022-09-03T00·49+0000
commit7da5076191d4037b9a0cfb5c818d64eb2822d9d0 (patch)
tree9408f16eb15e4e03f66099a0f35c5e149630e4b8 /tvix/eval/src/vm.rs
parent903b57be042b9f3f0ad6f714d4dec0c1795f93c0 (diff)
refactor(tvix/eval): rename Value::NotFound & OpAttrOrNotFound r/4613
grfn suggested clearer naming for these in cl/6166.

Change-Id: I83164bf1d1902ebd42272e9d5d63819a0f6a72c5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6277
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 6a7ebd5e64d2..65534006d0e1 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -225,15 +225,15 @@ impl VM {
                     }
                 }
 
-                OpCode::OpAttrOrNotFound => {
+                OpCode::OpAttrsTrySelect => {
                     let key = self.pop().to_string()?;
                     let value = match self.pop() {
                         Value::Attrs(attrs) => match attrs.select(key.as_str()) {
                             Some(value) => value.clone(),
-                            None => Value::NotFound,
+                            None => Value::AttrNotFound,
                         },
 
-                        _ => Value::NotFound,
+                        _ => Value::AttrNotFound,
                     };
 
                     self.push(value);
@@ -283,7 +283,7 @@ impl VM {
                 }
 
                 OpCode::OpJumpIfNotFound(offset) => {
-                    if matches!(self.peek(0), Value::NotFound) {
+                    if matches!(self.peek(0), Value::AttrNotFound) {
                         self.pop();
                         self.frame_mut().ip += offset;
                     }