Refactor code to remove Any
This commit is contained in:
@@ -7,7 +7,6 @@ use futures::StreamExt;
|
||||
use indicatif::{ProgressBar, ProgressStyle};
|
||||
use itertools::Itertools;
|
||||
use tokio::time::Instant;
|
||||
use crate::models;
|
||||
use crate::models::{DLSiteCategory, DLSiteGenre, DLSiteManiax, DLSiteTranslation};
|
||||
use crate::config::types::ApplicationConfig;
|
||||
use crate::constants::{DB_CF_OPTIONS, DB_OPTIONS};
|
||||
@@ -113,7 +112,7 @@ impl DLSiteSyncCommand {
|
||||
}
|
||||
|
||||
async fn sync_works(&self, app_conf: &ApplicationConfig, db: &mut RocksDB, crawler: &DLSiteCrawler) -> Result<()> {
|
||||
let existing_works = db.get_all_values::<models::DLSiteManiax>()?;
|
||||
let existing_works = db.get_all_values::<DLSiteManiax>()?;
|
||||
|
||||
let work_list = self.get_work_list(&app_conf, &existing_works).await?;
|
||||
let rj_nums = work_list.clone().into_keys().collect::<Vec<_>>();
|
||||
@@ -151,7 +150,7 @@ impl DLSiteSyncCommand {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn get_work_list(&self, app_conf: &ApplicationConfig, existing_works: &[models::DLSiteManiax]) -> Result<HashMap<String, PathBuf>> {
|
||||
async fn get_work_list(&self, app_conf: &ApplicationConfig, existing_works: &[DLSiteManiax]) -> Result<HashMap<String, PathBuf>> {
|
||||
let existing_nums = existing_works.iter()
|
||||
.map(|x| x.rj_num.clone())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Reference in New Issue
Block a user