Fix no_std build.

This commit is contained in:
Stephen Chung 2021-03-01 09:30:23 +08:00
parent 8eee21ff38
commit 733f4af8b3
3 changed files with 7 additions and 2 deletions

View File

@ -17,7 +17,7 @@ use crate::stdlib::{
iter::{empty, once}, iter::{empty, once},
mem, mem,
num::NonZeroU64, num::NonZeroU64,
string::ToString, string::{String, ToString},
vec::Vec, vec::Vec,
}; };
use crate::utils::combine_hashes; use crate::utils::combine_hashes;

View File

@ -2,6 +2,7 @@ use crate::dynamic::Variant;
use crate::stdlib::{ use crate::stdlib::{
boxed::Box, boxed::Box,
ops::{Add, Range}, ops::{Add, Range},
string::ToString,
}; };
use crate::{def_package, EvalAltResult, Position, INT}; use crate::{def_package, EvalAltResult, Position, INT};

View File

@ -348,7 +348,11 @@ impl EvalAltResult {
pub(crate) fn dump_fields(&self, map: &mut crate::Map) { pub(crate) fn dump_fields(&self, map: &mut crate::Map) {
map.insert( map.insert(
"error".into(), "error".into(),
format!("{:?}", self).split('(').next().unwrap().into(), crate::stdlib::format!("{:?}", self)
.split('(')
.next()
.unwrap()
.into(),
); );
match self { match self {