about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-08T13·38+0300
committertazjin <tazjin@tvl.su>2022-08-12T14·09+0000
commit0d2896519cf8dae97da024912d93c37b3c3bba85 (patch)
tree496a282070004acbcf7643383c7ac475e1bc59da /tvix
parent9c5a249b3059fa7951948b27ba5365d4570843ff (diff)
refactor(tvix/eval): move NumberPair struct definition to vm module r/4417
This isn't relevant to the value type itself.

Change-Id: I678bc92a8a530b1081ed498bf3ff7925217bcc01
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6081
Tested-by: BuildkiteCI
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/eval.rs2
-rw-r--r--tvix/eval/src/value.rs6
-rw-r--r--tvix/eval/src/vm.rs8
3 files changed, 8 insertions, 8 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index efa016ca9846..9d3f993ba273 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -1,7 +1,7 @@
 use rnix::{self, types::TypedNode};
 use std::fmt::Write;
 
-use crate::errors::{Error, EvalResult};
+use crate::errors::EvalResult;
 
 pub fn interpret(code: String) -> EvalResult<String> {
     let ast = rnix::parse(&code);
diff --git a/tvix/eval/src/value.rs b/tvix/eval/src/value.rs
index 842d561d67a6..699c7de7bcdd 100644
--- a/tvix/eval/src/value.rs
+++ b/tvix/eval/src/value.rs
@@ -39,9 +39,3 @@ impl Value {
         }
     }
 }
-
-#[derive(Clone, Copy, Debug, PartialEq)]
-pub enum NumberPair {
-    Floats(f64, f64),
-    Integer(i64, i64),
-}
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 7b7834c650c6..6841ac4706b3 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -5,7 +5,7 @@ use crate::{
     chunk::Chunk,
     errors::{Error, EvalResult},
     opcode::OpCode,
-    value::{NumberPair, Value},
+    value::Value,
 };
 
 pub struct VM {
@@ -123,6 +123,12 @@ impl VM {
     }
 }
 
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub enum NumberPair {
+    Floats(f64, f64),
+    Integer(i64, i64),
+}
+
 pub fn run_chunk(chunk: Chunk) -> EvalResult<Value> {
     let mut vm = VM {
         chunk,