Fix no_std builds by pulling in num-traits.

This commit is contained in:
Stephen Chung 2020-08-23 18:28:55 +08:00
parent 3902e49a7d
commit 1dacf21a84
2 changed files with 10 additions and 1 deletions

View File

@ -38,7 +38,7 @@ internals = [] # expose internal data structures
unicode-xid-ident = ["unicode-xid"] # allow Unicode Standard Annex #31 for identifiers. unicode-xid-ident = ["unicode-xid"] # allow Unicode Standard Annex #31 for identifiers.
# compiling for no-std # compiling for no-std
no_std = [ "no_closure", "hashbrown", "core-error", "libm", "ahash" ] no_std = [ "no_closure", "num-traits/libm", "hashbrown", "core-error", "libm", "ahash" ]
[profile.release] [profile.release]
lto = "fat" lto = "fat"
@ -51,6 +51,11 @@ version = "0.2.1"
default_features = false default_features = false
optional = true optional = true
[dependencies.num-traits]
version = "0.2.11"
default-features = false
optional = true
[dependencies.core-error] [dependencies.core-error]
version = "0.0.0" version = "0.0.0"
default_features = false default_features = false

View File

@ -52,6 +52,10 @@ use crate::stdlib::{
#[cfg(not(feature = "no_function"))] #[cfg(not(feature = "no_function"))]
use crate::stdlib::{collections::HashSet, string::String}; use crate::stdlib::{collections::HashSet, string::String};
#[cfg(feature = "no_std")]
#[cfg(not(feature = "no_float"))]
use num_traits::float::Float;
/// Extract the property name from a getter function name. /// Extract the property name from a getter function name.
#[inline(always)] #[inline(always)]
fn extract_prop_from_getter(_fn_name: &str) -> Option<&str> { fn extract_prop_from_getter(_fn_name: &str) -> Option<&str> {