Refactor code for readability

This commit is contained in:
Philip Kristoffersen
2021-10-06 21:50:09 +02:00
parent 95053a9d49
commit fc42cf6a1f
6 changed files with 141 additions and 112 deletions
+4 -4
View File
@@ -3,17 +3,17 @@ use std::io::Write;
use std::{collections::HashMap, path::Path};
use std::error::Error;
use steam_shortcuts_util::Shortcut;
use steam_shortcuts_util::shortcut::ShortcutOwned;
use steamgriddb_api::Client;
use crate::steamgriddb::ImageType;
use super::CachedSearch;
pub async fn download_images<'a, 'b>(
pub async fn download_images<'b>(
known_images: Vec<String>,
user_data_folder: &str,
shortcuts: Vec<Shortcut<'a>>,
shortcuts: &Vec<ShortcutOwned>,
search: &mut CachedSearch<'b>,
client: &Client,
) -> Result<(), Box<dyn Error>> {
@@ -31,7 +31,7 @@ pub async fn download_images<'a, 'b>(
}
let mut search_results = HashMap::new();
for s in shortcuts_to_search_for {
let search = search.search(s.app_id, s.app_name).await?;
let search = search.search(s.app_id, &s.app_name).await?;
if let Some(search) = search {
search_results.insert(s.app_id, search);
}