mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
this builds; unsure if correct
This commit is contained in:
1 parent
8bd0f22ff7
commit
4e2c18bece
1 file changed
+9
-5
@@ -86,17 +86,21 @@ impl TwitterClient {
|
||||
.track(&["vocodes"])
|
||||
.start(&self.access_token)
|
||||
//.fold(&self)
|
||||
.try_for_each(|m| {
|
||||
.try_for_each(|m: StreamMessage| {
|
||||
// NB: Odd implementation is due to future type juggling.
|
||||
// I should fix this, but I'm too lazy and have more work to do.
|
||||
if let StreamMessage::Tweet(tweet) = m {
|
||||
self.handle_tweet_mapping_errors(Some(tweet));
|
||||
let future = if let StreamMessage::Tweet(tweet) = m {
|
||||
self.handle_tweet_mapping_errors(Some(tweet))
|
||||
} else {
|
||||
info!("Other (non-Tweet) message: {:?}", &m);
|
||||
self.handle_tweet_mapping_errors(None);
|
||||
self.handle_tweet_mapping_errors(None)
|
||||
};
|
||||
|
||||
match block_on(future) {
|
||||
Ok(x) => futures::future::ok(x),
|
||||
Err(e) => futures::future::err(e),
|
||||
}
|
||||
|
||||
futures::future::ok(())
|
||||
});
|
||||
|
||||
match stream.await {
|
||||
|
||||
Reference in new issue
Block a user