refactor(tvix/eval): consume self
in Evaluation::evaluate
This simplifies lifetime management for observers in callers of tvix_eval. Change-Id: I2f47c8d89f22b1c766526e5d1483c0d026b500ae Reviewed-on: https://cl.tvl.fyi/c/depot/+/7546 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
59e695a9d9
commit
6d3d237923
2 changed files with 8 additions and 9 deletions
|
@ -20,10 +20,10 @@ struct Args {
|
|||
/// and the result itself. The return value indicates whether
|
||||
/// evaluation succeeded.
|
||||
fn interpret(code: &str, path: Option<PathBuf>) -> bool {
|
||||
let mut eval = tvix_eval::Evaluation::new(code, path);
|
||||
let eval = tvix_eval::Evaluation::new(code, path);
|
||||
let source_map = eval.source_map();
|
||||
let result = eval.evaluate();
|
||||
|
||||
let source_map = eval.source_map();
|
||||
for error in &result.errors {
|
||||
error.fancy_format_stderr(&source_map);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue