diff options
author | John-John Tedro <udoprog@tedro.se> | 2018-05-07 03:47:09 +0200 |
---|---|---|
committer | John-John Tedro <udoprog@tedro.se> | 2018-05-07 04:28:00 +0200 |
commit | 6ff5c445f37083c785111c904426c94b7a01f4b4 (patch) | |
tree | c77129d6c74c34e9c043566142dc6ab26644090a /src/ser.rs | |
parent | fd87ce35d563ecdac1f909d4540328365a16661f (diff) | |
download | milf-rs-6ff5c445f37083c785111c904426c94b7a01f4b4.tar.gz milf-rs-6ff5c445f37083c785111c904426c94b7a01f4b4.zip |
Use custom struct/field naming to deserialize spans
Diffstat (limited to 'src/ser.rs')
-rw-r--r-- | src/ser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -33,7 +33,7 @@ use std::marker; use std::rc::Rc; use serde::ser; -use datetime::{SERDE_STRUCT_FIELD_NAME, SERDE_STRUCT_NAME}; +use datetime; /// Serialize the given data structure as a TOML byte vector. /// @@ -924,7 +924,7 @@ impl<'a, 'b> ser::Serializer for &'b mut Serializer<'a> { fn serialize_struct(self, name: &'static str, _len: usize) -> Result<Self::SerializeStruct, Self::Error> { - if name == SERDE_STRUCT_NAME { + if name == datetime::NAME { self.array_type("datetime")?; Ok(SerializeTable::Datetime(self)) } else { @@ -1071,7 +1071,7 @@ impl<'a, 'b> ser::SerializeStruct for SerializeTable<'a, 'b> { { match *self { SerializeTable::Datetime(ref mut ser) => { - if key == SERDE_STRUCT_FIELD_NAME { + if key == datetime::FIELD { value.serialize(DateStrEmitter(&mut *ser))?; } else { return Err(Error::DateInvalid) |