diff options
author | Teddy Wing | 2018-04-15 01:08:15 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-15 01:08:15 +0200 |
commit | aa0190279db75f75210f5279afaa62178b242837 (patch) | |
tree | 81eb9a5c228fdb70e135976b51a8aa9d47439337 | |
parent | 2140a2f63ce6f8da3684806d814d905987013de5 (diff) | |
download | meetup-find-events-rss-aa0190279db75f75210f5279afaa62178b242837.tar.bz2 |
Event: Make `description`, `local_date`, `local_time` optional
After making a request to the API and getting a real JSON response
again, it turns out that the above mentioned fields are actually
optional, and will break Serde's parsing when they're not in the JSON
string coming from Meetup. Make these fields `Option`s so the program
doesn't break when they're not there.
-rw-r--r-- | meetup/src/event.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meetup/src/event.rs b/meetup/src/event.rs index 1f90429..d25c1d2 100644 --- a/meetup/src/event.rs +++ b/meetup/src/event.rs @@ -1,10 +1,10 @@ #[derive(Debug, Deserialize, PartialEq)] pub struct Event { pub name: String, - pub description: String, + pub description: Option<String>, pub link: String, - pub local_date: String, - pub local_time: String, + pub local_date: Option<String>, + pub local_time: Option<String>, // venue struct } |