aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml/reader.rs
diff options
context:
space:
mode:
authorEdward Barnard2018-02-27 10:22:42 +0000
committerEdward Barnard2018-02-27 10:33:54 +0000
commitc91087906540c210bdb457b32fb976ce735b22f9 (patch)
tree1968d9710404fc8386f68c56f705d5d02774bbbb /src/xml/reader.rs
parent3ad6b78c4583b9ea8a801cd963d569eecbae144b (diff)
downloadrust-plist-c91087906540c210bdb457b32fb976ce735b22f9.tar.bz2
Stop exposing internal functions and chrono types in Date.
Diffstat (limited to 'src/xml/reader.rs')
-rw-r--r--src/xml/reader.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xml/reader.rs b/src/xml/reader.rs
index e6b6953..66fd8f1 100644
--- a/src/xml/reader.rs
+++ b/src/xml/reader.rs
@@ -72,7 +72,7 @@ impl<R: Read> EventReader<R> {
}
"date" => {
return Some(self.read_content(|s| {
- Ok(PlistEvent::DateValue(Date::from_str(&s).map_err(|_| Error::InvalidData)?))
+ Ok(PlistEvent::DateValue(Date::from_rfc3339(&s)?))
}))
}
"integer" => {
@@ -176,7 +176,7 @@ mod tests {
StringValue("Data".to_owned()),
DataValue(vec![0, 0, 0, 190, 0, 0, 0, 3, 0, 0, 0, 30, 0, 0, 0]),
StringValue("Birthdate".to_owned()),
- DateValue(Utc.ymd(1981, 05, 16).and_hms(11, 32, 06).into()),
+ DateValue(Date::from_chrono(Utc.ymd(1981, 05, 16).and_hms(11, 32, 06))),
StringValue("Blank".to_owned()),
StringValue("".to_owned()),
EndDictionary];