Fix clippy warnings and typos (#434)

* Fix clippy warnings.

* Fixe more clippy warnings.

* Fix exided lifetime warnings in clippy.

* Fix errors.

* Fix errors.

---------

Co-authored-by: Guy Chronister <guyc.linux.patches@gmail.com>
This commit is contained in:
guylamar2006
2025-01-12 21:29:42 +01:00
committed by GitHub
co-authored by Guy Chronister
parent 6bc3908fe2
commit f19bf2e30f
18 changed files with 55 additions and 64 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ pub struct CachedSearch<'a> {
}
impl<'a> CachedSearch<'a> {
pub fn new(client: &steamgriddb_api::Client) -> CachedSearch {
pub fn new(client: &'a steamgriddb_api::Client) -> CachedSearch<'a> {
CachedSearch {
search_map: get_search_map(),
client,
+5 -5
View File
@@ -45,7 +45,7 @@ impl SearchSettings for Settings {
}
}
pub async fn download_images_for_users<'b>(
pub async fn download_images_for_users(
settings: &Settings,
users: &[SteamUsersInfo],
sender: &mut Option<Sender<SyncProgress>>,
@@ -388,10 +388,10 @@ async fn get_steam_image_url(game_id: usize, image_type: &ImageType) -> Option<S
d.platforms
.map(|p| p.steam.map(|s| s.metadata.map(|m| m.store_asset_mtime)))
});
if let (Some(Some(Some(steam_app_id))), Some(Some(Some(Some(Some(mtime)))))) =
if let (Some(Some(Some(steam_app_id))), Some(Some(Some(Some(mtime))))) =
(game_id, mtime)
{
return Some(image_type.steam_url(steam_app_id, mtime));
return Some(image_type.steam_url(steam_app_id.to_string(), mtime?));
}
}
}
@@ -412,10 +412,10 @@ async fn get_steam_icon_url(game_id: usize) -> Option<String> {
d.platforms
.map(|p| p.steam.map(|s| s.metadata.map(|m| m.clienticon)))
});
if let (Some(Some(Some(steam_app_id))), Some(Some(Some(Some(Some(mtime)))))) =
if let (Some(Some(Some(steam_app_id))), Some(Some(Some(Some(mtime))))) =
(game_id, mtime)
{
return Some(icon_url(&steam_app_id, &mtime));
return Some(icon_url(&steam_app_id.to_string(), &mtime?.to_string()));
}
}
}