aboutsummaryrefslogtreecommitdiffstats
path: root/meetup
diff options
context:
space:
mode:
authorTeddy Wing2018-04-13 18:49:45 +0200
committerTeddy Wing2018-04-13 18:49:45 +0200
commit9c52f6e0b4db6ce7c732e33feceb40743611d35c (patch)
treef98a623489df0a5bb0593fe911ed8dfa48d2cb9a /meetup
parentbec71778782a22f439146f879e3666b27b54729b (diff)
downloadmeetup-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.rs7
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> {