tolerate decks with missing mtime exported by third party software

This commit is contained in:
Damien Elmes 2020-05-02 10:15:41 +10:00
parent e980ba3686
commit 38a109a5bf
2 changed files with 6 additions and 1 deletions

View file

@ -76,7 +76,11 @@ mod dynfix {
pub struct DeckCommon { pub struct DeckCommon {
#[serde(deserialize_with = "deserialize_number_from_string")] #[serde(deserialize_with = "deserialize_number_from_string")]
pub(crate) id: DeckID, pub(crate) id: DeckID,
#[serde(rename = "mod", deserialize_with = "deserialize_number_from_string")] #[serde(
rename = "mod",
deserialize_with = "deserialize_number_from_string",
default
)]
pub(crate) mtime: TimestampSecs, pub(crate) mtime: TimestampSecs,
pub(crate) name: String, pub(crate) name: String,
pub(crate) usn: Usn, pub(crate) usn: Usn,

View file

@ -7,6 +7,7 @@ macro_rules! define_newtype {
#[repr(transparent)] #[repr(transparent)]
#[derive( #[derive(
Debug, Debug,
Default,
Clone, Clone,
Copy, Copy,
PartialEq, PartialEq,