Add no_time.

This commit is contained in:
Stephen Chung
2022-10-15 12:37:42 +08:00
parent 9b226f321e
commit a6a570131a
12 changed files with 37 additions and 2 deletions

View File

@@ -157,6 +157,7 @@ impl<'de> Deserializer<'de> for DynamicDeserializer<'de> {
Union::Map(..) => self.deserialize_map(visitor),
Union::FnPtr(..) => self.type_error(),
#[cfg(not(feature = "no_std"))]
#[cfg(not(feature = "no_time"))]
Union::TimeStamp(..) => self.type_error(),
Union::Variant(ref value, ..) if value.is::<i8>() => self.deserialize_i8(visitor),

View File

@@ -10,6 +10,7 @@ use std::prelude::v1::*;
use serde::ser::SerializeMap;
#[cfg(not(feature = "no_std"))]
#[cfg(not(feature = "no_time"))]
use crate::types::dynamic::Variant;
impl Serialize for Dynamic {
@@ -66,6 +67,7 @@ impl Serialize for Dynamic {
}
Union::FnPtr(ref f, ..) => ser.serialize_str(f.fn_name()),
#[cfg(not(feature = "no_std"))]
#[cfg(not(feature = "no_time"))]
Union::TimeStamp(ref x, ..) => ser.serialize_str(x.as_ref().type_name()),
Union::Variant(ref v, ..) => ser.serialize_str((***v).type_name()),