Fix serde feature.
This commit is contained in:
parent
10da4d8976
commit
206400b187
@ -178,7 +178,9 @@ impl Engine {
|
|||||||
// Search for the native function
|
// Search for the native function
|
||||||
// First search registered functions (can override packages)
|
// First search registered functions (can override packages)
|
||||||
// Then search packages
|
// Then search packages
|
||||||
// lib.get_fn(hash_fn, pub_only)
|
// Finally search modules
|
||||||
|
|
||||||
|
//lib.get_fn(hash_fn, pub_only)
|
||||||
let f = self
|
let f = self
|
||||||
.global_namespace
|
.global_namespace
|
||||||
.get_fn(hash_fn, pub_only)
|
.get_fn(hash_fn, pub_only)
|
||||||
@ -211,17 +213,16 @@ impl Engine {
|
|||||||
|
|
||||||
// See if the function match print/debug (which requires special processing)
|
// See if the function match print/debug (which requires special processing)
|
||||||
return Ok(match fn_name {
|
return Ok(match fn_name {
|
||||||
KEYWORD_PRINT => (
|
KEYWORD_PRINT => {
|
||||||
(self.print)(result.as_str().map_err(|typ| {
|
let text = result.as_str().map_err(|typ| {
|
||||||
EvalAltResult::ErrorMismatchOutputType(
|
EvalAltResult::ErrorMismatchOutputType(
|
||||||
self.map_type_name(type_name::<ImmutableString>()).into(),
|
self.map_type_name(type_name::<ImmutableString>()).into(),
|
||||||
typ.into(),
|
typ.into(),
|
||||||
pos,
|
pos,
|
||||||
)
|
)
|
||||||
})?)
|
})?;
|
||||||
.into(),
|
((self.print)(text).into(), false)
|
||||||
false,
|
}
|
||||||
),
|
|
||||||
KEYWORD_DEBUG => {
|
KEYWORD_DEBUG => {
|
||||||
let text = result.as_str().map_err(|typ| {
|
let text = result.as_str().map_err(|typ| {
|
||||||
EvalAltResult::ErrorMismatchOutputType(
|
EvalAltResult::ErrorMismatchOutputType(
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use super::str::ImmutableStringDeserializer;
|
use super::str::ImmutableStringDeserializer;
|
||||||
use crate::dynamic::Union;
|
use crate::dynamic::Union;
|
||||||
use crate::stdlib::{any::type_name, boxed::Box, fmt, string::ToString};
|
use crate::stdlib::{any::type_name, boxed::Box, fmt, string::ToString};
|
||||||
use crate::{Dynamic, EvalAltResult, ImmutableString, LexError, ParseErrorType, Position};
|
use crate::{Dynamic, EvalAltResult, ImmutableString, LexError, Position};
|
||||||
use serde::de::{
|
use serde::de::{
|
||||||
DeserializeSeed, Deserializer, Error, IntoDeserializer, MapAccess, SeqAccess, Visitor,
|
DeserializeSeed, Deserializer, Error, IntoDeserializer, MapAccess, SeqAccess, Visitor,
|
||||||
};
|
};
|
||||||
@ -122,7 +122,6 @@ impl Error for Box<EvalAltResult> {
|
|||||||
LexError::ImproperSymbol("".to_string(), err.to_string())
|
LexError::ImproperSymbol("".to_string(), err.to_string())
|
||||||
.into_err(Position::NONE)
|
.into_err(Position::NONE)
|
||||||
.into()
|
.into()
|
||||||
.into()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user