Split tokenizer into separate file, plus fix no_std feature.

This commit is contained in:
Stephen Chung
2020-04-15 22:21:23 +08:00
parent 78cd53db09
commit a35518fe49
15 changed files with 1071 additions and 1041 deletions

View File

@@ -10,9 +10,12 @@ use crate::stdlib::{
any::{type_name, Any, TypeId},
boxed::Box,
fmt,
time::Instant,
string::String,
};
#[cfg(not(feature = "no_std"))]
use crate::stdlib::time::Instant;
/// A trait to represent any type.
///
/// Currently, `Variant` is not `Send` nor `Sync`, so it can practically be any type.
@@ -186,6 +189,7 @@ impl Dynamic {
Union::Array(_) => "array",
Union::Map(_) => "map",
#[cfg(not(feature = "no_std"))]
Union::Variant(value) if value.is::<Instant>() => "timestamp",
Union::Variant(value) => (**value).type_name(),
}