diff options
author | Teddy Wing | 2018-04-13 18:49:45 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-13 18:49:45 +0200 |
commit | 9c52f6e0b4db6ce7c732e33feceb40743611d35c (patch) | |
tree | f98a623489df0a5bb0593fe911ed8dfa48d2cb9a /meetup | |
parent | bec71778782a22f439146f879e3666b27b54729b (diff) | |
download | meetup-find-events-rss-9c52f6e0b4db6ce7c732e33feceb40743611d35c.tar.bz2 |
meetup(find_upcoming_events): Make this function actually do something
Eventually, I want this function to make a request to the Meetup API and
return a `Vec` of `Event`s.
For now, though, so we can test things out, use our test JSON file
instead of a real web request.
Diffstat (limited to 'meetup')
-rw-r--r-- | meetup/src/event.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/meetup/src/event.rs b/meetup/src/event.rs index bc0b6be..ebd3174 100644 --- a/meetup/src/event.rs +++ b/meetup/src/event.rs @@ -12,8 +12,11 @@ pub struct Event { } -// pub fn find_upcoming_events() -> Vec<Event> { -// } +pub fn find_upcoming_events() -> Result<Vec<Event>, serde_json::Error> { + let json = include_str!("../testdata/meetup--find-upcoming_events.json").to_owned(); + + parse_json(json) +} fn parse_json(json: String) -> Result<Vec<Event>, serde_json::Error> { |