diff --git a/src/event.rs b/src/event.rs index ec0f59a..5cf27c0 100644 --- a/src/event.rs +++ b/src/event.rs @@ -19,12 +19,13 @@ pub struct Event { type Tag = Vec>; +// handle a default value (empty vec) for null tags fn tag_from_string<'de, D>(deserializer: D) -> Result where D: Deserializer<'de>, { - let s: Option = Deserialize::deserialize(deserializer)?; - Ok(vec![]) + let opt = Option::deserialize(deserializer)?; + Ok(opt.unwrap_or_else(|| vec![])) } fn u32_from_string<'de, D>(deserializer: D) -> Result