Fix tests.
This commit is contained in:
parent
d8532b48b6
commit
d9ffac17fa
@ -201,7 +201,7 @@ impl<'e> ParseState<'e> {
|
|||||||
} else {
|
} else {
|
||||||
NonZeroUsize::new(index)
|
NonZeroUsize::new(index)
|
||||||
};
|
};
|
||||||
|
|
||||||
(index, is_func)
|
(index, is_func)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
//! Implement deserialization support of [`Dynamic`][crate::Dynamic] for [`serde`].
|
//! Implement deserialization support of [`Dynamic`][crate::Dynamic] for [`serde`].
|
||||||
|
|
||||||
use crate::types::dynamic::Union;
|
use crate::types::dynamic::Union;
|
||||||
use crate::{
|
use crate::{Dynamic, ImmutableString, LexError, Position, RhaiError, RhaiResultOf, ERR};
|
||||||
Dynamic, ImmutableString, LexError, Position, RhaiError, RhaiResultOf, SmartString, ERR,
|
|
||||||
};
|
|
||||||
use serde::de::{Error, IntoDeserializer, Visitor};
|
use serde::de::{Error, IntoDeserializer, Visitor};
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
#[cfg(feature = "no_std")]
|
#[cfg(feature = "no_std")]
|
||||||
@ -422,7 +420,7 @@ impl<'de> Deserializer<'de> for &mut DynamicDeserializer<'de> {
|
|||||||
|| self.type_error(),
|
|| self.type_error(),
|
||||||
|map| {
|
|map| {
|
||||||
_visitor.visit_map(IterateMap::new(
|
_visitor.visit_map(IterateMap::new(
|
||||||
map.keys().map(SmartString::as_str),
|
map.keys().map(crate::SmartString::as_str),
|
||||||
map.values(),
|
map.values(),
|
||||||
))
|
))
|
||||||
},
|
},
|
||||||
|
@ -105,8 +105,7 @@ fn test_options_strict_var() -> Result<(), Box<EvalAltResult>> {
|
|||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
{
|
{
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
engine
|
engine.eval_with_scope::<INT>(&mut scope, "fn foo(z) { z } let f = foo; call(f, x)")?,
|
||||||
.eval_with_scope::<INT>(&mut scope, "fn foo(z) { y + z } let f = foo; f.call(x)")?,
|
|
||||||
42
|
42
|
||||||
);
|
);
|
||||||
assert!(engine.compile("let f = |y| x * y;").is_err());
|
assert!(engine.compile("let f = |y| x * y;").is_err());
|
||||||
|
Loading…
Reference in New Issue
Block a user