Fix benchmark.
This commit is contained in:
parent
fb0b071fe0
commit
5c0cf70f70
@ -3,7 +3,7 @@
|
|||||||
///! Test evaluating with scope
|
///! Test evaluating with scope
|
||||||
extern crate test;
|
extern crate test;
|
||||||
|
|
||||||
use rhai::{Engine, Module, OptimizationLevel};
|
use rhai::{Engine, Module, OptimizationLevel, Scope};
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
@ -18,7 +18,7 @@ fn bench_eval_module(bench: &mut Bencher) {
|
|||||||
|
|
||||||
let ast = engine.compile(script).unwrap();
|
let ast = engine.compile(script).unwrap();
|
||||||
|
|
||||||
let module = Module::eval_ast_as_new(&mut Scope::new(), &ast, &engine).unwrap();
|
let module = Module::eval_ast_as_new(Scope::new(), &ast, &engine).unwrap();
|
||||||
|
|
||||||
engine.register_static_module("testing", module.into());
|
engine.register_static_module("testing", module.into());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user