From 733f4af8b32c24f288436a2fe341c351173af83e Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Mon, 1 Mar 2021 09:30:23 +0800 Subject: [PATCH] Fix no_std build. --- src/fn_call.rs | 2 +- src/packages/iter_basic.rs | 1 + src/result.rs | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/fn_call.rs b/src/fn_call.rs index 60be49f0..4f91dc94 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -17,7 +17,7 @@ use crate::stdlib::{ iter::{empty, once}, mem, num::NonZeroU64, - string::ToString, + string::{String, ToString}, vec::Vec, }; use crate::utils::combine_hashes; diff --git a/src/packages/iter_basic.rs b/src/packages/iter_basic.rs index 9d37c2c8..3fc39d50 100644 --- a/src/packages/iter_basic.rs +++ b/src/packages/iter_basic.rs @@ -2,6 +2,7 @@ use crate::dynamic::Variant; use crate::stdlib::{ boxed::Box, ops::{Add, Range}, + string::ToString, }; use crate::{def_package, EvalAltResult, Position, INT}; diff --git a/src/result.rs b/src/result.rs index c344729e..1e6ec07b 100644 --- a/src/result.rs +++ b/src/result.rs @@ -348,7 +348,11 @@ impl EvalAltResult { pub(crate) fn dump_fields(&self, map: &mut crate::Map) { map.insert( "error".into(), - format!("{:?}", self).split('(').next().unwrap().into(), + crate::stdlib::format!("{:?}", self) + .split('(') + .next() + .unwrap() + .into(), ); match self {