aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Barnard2018-03-16 11:24:05 +0000
committerEdward Barnard2018-03-16 11:24:05 +0000
commitf5c460c481db5cc020959216eb812ac6b4f65b0b (patch)
treef5682c30ced1f689a4917d8ba94ab6c52e1a2533
parent8c2d6a8463dd00ee956d196914b65d6b235e5992 (diff)
downloadrust-plist-f5c460c481db5cc020959216eb812ac6b4f65b0b.tar.bz2
Provide an improved debug implementation for Date.
-rw-r--r--src/date.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/date.rs b/src/date.rs
index 43dec90..6489582 100644
--- a/src/date.rs
+++ b/src/date.rs
@@ -1,10 +1,12 @@
use chrono::{DateTime, Duration, TimeZone, Utc};
+use std::fmt;
+use std::result::Result as StdResult;
use std::time::SystemTime;
use {Error, Result};
/// A UTC timestamp. Used for serialization to and from the plist date type.
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, PartialEq)]
pub struct Date {
inner: DateTime<Utc>,
}
@@ -55,6 +57,12 @@ impl Date {
}
}
+impl fmt::Debug for Date {
+ fn fmt(&self, f: &mut fmt::Formatter) -> StdResult<(), fmt::Error> {
+ self.inner.fmt(f)
+ }
+}
+
impl From<SystemTime> for Date {
fn from(date: SystemTime) -> Self {
Date { inner: date.into() }