Better implementation for Expression::get_literal_value.

This commit is contained in:
Stephen Chung
2021-06-16 12:24:36 +08:00
parent b5898f451e
commit 03cb398edf
2 changed files with 51 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ fn test_custom_syntax() -> Result<(), Box<EvalAltResult>> {
true,
|context, inputs| {
let var_name = inputs[0].get_variable_name().unwrap().to_string();
let max = inputs[1].get_literal_value().unwrap().as_int().unwrap();
let max = inputs[1].get_literal_value::<INT>().unwrap();
let stmt = inputs.get(2).unwrap();
let condition = inputs.get(3).unwrap();