refactor(tvix/eval): remove unnecessary clones in compiler

There's basically nothing that needs *ownership* of an AST
node (which is just a little box full of references to other things
anyways), so we can thread this through as references all the way.

Change-Id: I35a1348a50c0e8e07d51dfc18847829379166fbf
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6853
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-10-03 17:08:39 +03:00 committed by tazjin
parent b69b50feb1
commit 2ff764ceb7
4 changed files with 147 additions and 151 deletions

View file

@ -60,7 +60,7 @@ pub fn interpret(code: &str, location: Option<PathBuf>, options: Options) -> Eva
let result = if options.dump_bytecode {
crate::compiler::compile(
root_expr,
&root_expr,
location,
file.clone(),
global_builtins(),
@ -68,7 +68,7 @@ pub fn interpret(code: &str, location: Option<PathBuf>, options: Options) -> Eva
)
} else {
crate::compiler::compile(
root_expr,
&root_expr,
location,
file.clone(),
global_builtins(),