speclatively use stdlib to have automatic no_std compatibility

This commit is contained in:
Steve Fan 2020-06-26 00:40:01 +08:00
parent 6be9301a26
commit 0bd636a660
3 changed files with 3 additions and 11 deletions

View File

@ -3,10 +3,7 @@
use crate::result::EvalAltResult;
use crate::token::Position;
use crate::stdlib::{boxed::Box, char, error::Error, fmt, string::String};
#[cfg(feature = "no_std")]
use crate::alloc::string::ToString;
use crate::stdlib::{boxed::Box, char, error::Error, fmt, string::{String, ToString}};
/// Error when tokenizing the script text.
#[derive(Debug, Eq, PartialEq, Clone, Hash)]

View File

@ -8,10 +8,7 @@ use crate::parser::{ImmutableString, INT};
use crate::result::EvalAltResult;
use crate::token::Position;
use crate::stdlib::{any::TypeId, boxed::Box};
#[cfg(feature = "no_std")]
use crate::alloc::string::ToString;
use crate::stdlib::{any::TypeId, boxed::Box, string::ToString};
// Register array utility functions
fn push<T: Variant + Clone>(list: &mut Array, item: T) -> FuncReturn<()> {

View File

@ -10,11 +10,9 @@ use crate::utils::StaticVec;
#[cfg(not(feature = "no_index"))]
use crate::engine::Array;
#[cfg(feature = "no_std")]
use crate::alloc::boxed::Box;
use crate::stdlib::{
any::TypeId,
boxed::Box,
fmt::Display,
format,
string::{String, ToString},