Fix errors.
This commit is contained in:
parent
6416e406d3
commit
77eb96bd7e
@ -308,8 +308,6 @@ impl EvalAltResult {
|
|||||||
/// Get the [position][Position] of this error.
|
/// Get the [position][Position] of this error.
|
||||||
#[cfg(not(feature = "no_object"))]
|
#[cfg(not(feature = "no_object"))]
|
||||||
pub(crate) fn dump_fields(&self, map: &mut crate::Map) {
|
pub(crate) fn dump_fields(&self, map: &mut crate::Map) {
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
map.insert(
|
map.insert(
|
||||||
"error".into(),
|
"error".into(),
|
||||||
format!("{:?}", self)
|
format!("{:?}", self)
|
||||||
@ -376,12 +374,15 @@ impl EvalAltResult {
|
|||||||
Self::ErrorCustomSyntax(_, tokens, _) => {
|
Self::ErrorCustomSyntax(_, tokens, _) => {
|
||||||
map.insert(
|
map.insert(
|
||||||
"tokens".into(),
|
"tokens".into(),
|
||||||
Dynamic::from_array(
|
#[cfg(not(feature = "no_index"))]
|
||||||
|
Dynamic::from_array(tokens.iter().map(Into::into).collect()),
|
||||||
|
#[cfg(feature = "no_index")]
|
||||||
tokens
|
tokens
|
||||||
.iter()
|
.iter()
|
||||||
.map(|s| Dynamic::from_str(s).unwrap())
|
.map(|s| s.as_str())
|
||||||
.collect(),
|
.collect::<Vec<_>>()
|
||||||
),
|
.join(" ")
|
||||||
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user