minor refactor

This commit is contained in:
Lukáš Hozda
2017-12-21 12:28:59 +01:00
parent 13f7f43f98
commit 5edcfc2156
7 changed files with 39 additions and 120 deletions

View File

@@ -5,12 +5,7 @@ fn main() {
let mut engine = Engine::new();
let mut scope: Scope = Vec::new();
if !engine
.eval_with_scope::<()>(&mut scope, "let x = 4 + 5")
.is_ok()
{
assert!(false);
}
assert!(engine.eval_with_scope::<()>(&mut scope, "let x = 4 + 5").is_ok());
if let Ok(result) = engine.eval_with_scope::<i64>(&mut scope, "x") {
println!("result: {}", result);