mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-20 17:11:19 +02:00
Revert "Use futures instead of tokio (for just one call, sounds more appropriate)"
This reverts commit 9809327784
This commit is contained in:
@@ -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))?;
|
||||
|
||||
|
Reference in New Issue
Block a user