Revert "Use futures instead of tokio (for just one call, sounds more appropriate)"

This reverts commit 9809327784
This commit is contained in:
VC
2020-07-27 21:02:10 +02:00
parent 9809327784
commit 1f98954d2e
3 changed files with 8 additions and 7 deletions

View File

@@ -9,8 +9,8 @@ use std::{
error::Error,
};
// futures
use futures::executor::block_on;
//tokio
use tokio::runtime::Runtime;
// toml
use serde::Deserialize;
@@ -77,7 +77,8 @@ fn get_oauth2_token(config: &Config) -> Token {
/// Get twitter user timeline
fn get_user_timeline(config: &Config, token: Token, lid: Option<u64>) -> Result<Vec<Tweet>, Box<dyn Error>> {
// fix the page size to 200 as it is the maximum Twitter authorizes
let (_timeline, feed) = block_on(user_timeline(UserID::from(String::from(&config.twitter.username)), true, false, &token)
let mut rt = Runtime::new()?;
let (_timeline, feed) = rt.block_on(user_timeline(UserID::from(String::from(&config.twitter.username)), true, false, &token)
.with_page_size(200)
.older(lid))?;