FIX - Errors in no_std.
This commit is contained in:
parent
3677bd3651
commit
7b06715299
@ -7,7 +7,11 @@ fn main() -> Result<(), EvalAltResult> {
|
|||||||
|
|
||||||
let result = engine.eval::<INT>("40 + 2")?;
|
let result = engine.eval::<INT>("40 + 2")?;
|
||||||
|
|
||||||
println!("Answer: {}", 42);
|
#[cfg(not(feature = "no_std"))]
|
||||||
|
println!("Answer: {}", result);
|
||||||
|
|
||||||
|
#[cfg(feature = "no_std")]
|
||||||
|
assert_eq!(result, 42);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ impl<'e> Engine<'e> {
|
|||||||
name: &str,
|
name: &str,
|
||||||
callback: impl Fn(&mut T) -> U + 'static,
|
callback: impl Fn(&mut T) -> U + 'static,
|
||||||
) {
|
) {
|
||||||
let get_fn_name = format!("{}{}", FUNC_GETTER, name);
|
let get_fn_name = FUNC_GETTER.to_string() + name;
|
||||||
self.register_fn(&get_fn_name, callback);
|
self.register_fn(&get_fn_name, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ impl<'e> Engine<'e> {
|
|||||||
name: &str,
|
name: &str,
|
||||||
callback: impl Fn(&mut T, U) -> () + 'static,
|
callback: impl Fn(&mut T, U) -> () + 'static,
|
||||||
) {
|
) {
|
||||||
let set_fn_name = format!("{}{}", FUNC_SETTER, name);
|
let set_fn_name = FUNC_SETTER.to_string() + name;
|
||||||
self.register_fn(&set_fn_name, callback);
|
self.register_fn(&set_fn_name, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user