From b467b187225ec222abfe03e55c15d8b69a6ffe51 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 25 Oct 2020 22:08:02 +0800 Subject: [PATCH] Fix no_std build. --- src/fn_call.rs | 2 +- src/packages/iter_basic.rs | 4 ++++ src/syntax.rs | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/fn_call.rs b/src/fn_call.rs index 246f3060..fa57a559 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -1055,7 +1055,7 @@ impl Engine { } else { // If the first argument is a variable, and there is no curried arguments, convert to method-call style // in order to leverage potential &mut first argument and avoid cloning the value - if curry.is_empty() && args_expr[0].get_variable_access(false).is_some() { + if curry.is_empty() && args_expr[0].get_variable_access(false).is_some() { // func(x, ...) -> x.func(...) arg_values = args_expr .iter() diff --git a/src/packages/iter_basic.rs b/src/packages/iter_basic.rs index 46ab0119..0d8d1e8f 100644 --- a/src/packages/iter_basic.rs +++ b/src/packages/iter_basic.rs @@ -45,6 +45,8 @@ where Ok(StepRange::(from, to, step)) } +#[cfg(not(feature = "only_i32"))] +#[cfg(not(feature = "only_i64"))] macro_rules! reg_range { ($lib:expr, $x:expr, $( $y:ty ),*) => ( $( @@ -54,6 +56,8 @@ macro_rules! reg_range { ) } +#[cfg(not(feature = "only_i32"))] +#[cfg(not(feature = "only_i64"))] macro_rules! reg_step { ($lib:expr, $x:expr, $( $y:ty ),*) => ( $( diff --git a/src/syntax.rs b/src/syntax.rs index 5096547f..32f27a07 100644 --- a/src/syntax.rs +++ b/src/syntax.rs @@ -10,7 +10,11 @@ use crate::token::{is_valid_identifier, Position, Token}; use crate::utils::ImmutableString; use crate::StaticVec; -use crate::stdlib::{boxed::Box, format, string::ToString}; +use crate::stdlib::{ + boxed::Box, + format, + string::{String, ToString}, +}; /// A general expression evaluation trait object. #[cfg(not(feature = "sync"))]