diff options
| author | Edward Barnard | 2018-03-16 11:24:05 +0000 |
|---|---|---|
| committer | Edward Barnard | 2018-03-16 11:24:05 +0000 |
| commit | f5c460c481db5cc020959216eb812ac6b4f65b0b (patch) | |
| tree | f5682c30ced1f689a4917d8ba94ab6c52e1a2533 | |
| parent | 8c2d6a8463dd00ee956d196914b65d6b235e5992 (diff) | |
| download | rust-plist-f5c460c481db5cc020959216eb812ac6b4f65b0b.tar.bz2 | |
Provide an improved debug implementation for Date.
| -rw-r--r-- | src/date.rs | 10 |
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() } |
