From aa0190279db75f75210f5279afaa62178b242837 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 15 Apr 2018 01:08:15 +0200 Subject: 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. --- meetup/src/event.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'meetup') 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, pub link: String, - pub local_date: String, - pub local_time: String, + pub local_date: Option, + pub local_time: Option, // venue struct } -- cgit v1.2.3