Handle more data types in Expr::from_dynamic.

This commit is contained in:
Stephen Chung 2021-07-14 13:52:40 +08:00
parent 713f8ea672
commit dad1fe8392

View File

@ -843,7 +843,7 @@ impl Dynamic {
/// Not available under `no_float`.
#[cfg(not(feature = "no_float"))]
pub const FLOAT_ZERO: Dynamic = Self(Union::Float(
FloatWrapper::const_new(0.0),
FloatWrapper::new_const(0.0),
DEFAULT_TAG_VALUE,
ReadWrite,
));
@ -852,7 +852,7 @@ impl Dynamic {
/// Not available under `no_float`.
#[cfg(not(feature = "no_float"))]
pub const FLOAT_ONE: Dynamic = Self(Union::Float(
FloatWrapper::const_new(1.0),
FloatWrapper::new_const(1.0),
DEFAULT_TAG_VALUE,
ReadWrite,
));
@ -861,7 +861,7 @@ impl Dynamic {
/// Not available under `no_float`.
#[cfg(not(feature = "no_float"))]
pub const FLOAT_TWO: Dynamic = Self(Union::Float(
FloatWrapper::const_new(2.0),
FloatWrapper::new_const(2.0),
DEFAULT_TAG_VALUE,
ReadWrite,
));
@ -870,7 +870,7 @@ impl Dynamic {
/// Not available under `no_float`.
#[cfg(not(feature = "no_float"))]
pub const FLOAT_TEN: Dynamic = Self(Union::Float(
FloatWrapper::const_new(10.0),
FloatWrapper::new_const(10.0),
DEFAULT_TAG_VALUE,
ReadWrite,
));
@ -879,7 +879,7 @@ impl Dynamic {
/// Not available under `no_float`.
#[cfg(not(feature = "no_float"))]
pub const FLOAT_NEGATIVE_ONE: Dynamic = Self(Union::Float(
FloatWrapper::const_new(-1.0),
FloatWrapper::new_const(-1.0),
DEFAULT_TAG_VALUE,
ReadWrite,
));