mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-20 17:11:19 +02:00
refactor: optimize import and last_tweet_id var
This commit is contained in:
@@ -33,10 +33,7 @@ pub async fn run(config: Config) {
|
||||
// open the SQLite connection
|
||||
let conn = Connection::open(&config.scootaloo.db_path).unwrap();
|
||||
// retrieve the last tweet ID for the username
|
||||
let last_tweet_id = match read_state(&conn, None).unwrap() {
|
||||
Some(i) => Some(i.tweet_id),
|
||||
None => None,
|
||||
};
|
||||
let last_tweet_id = read_state(&conn, None).unwrap().map(|s| s.tweet_id);
|
||||
|
||||
// get OAuth2 token
|
||||
let token = get_oauth2_token(&config.twitter);
|
||||
|
Reference in New Issue
Block a user