diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2859011..b4d48e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: test_Ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Rust Cache uses: Swatinem/rust-cache@v2 - name: dependencies @@ -28,7 +28,7 @@ jobs: test_Windows: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install latest stable uses: actions-rs/toolchain@v1 with: @@ -41,7 +41,7 @@ jobs: # test_Macos: # runs-on: macos-latest # steps: - # - uses: actions/checkout@v3 + # - uses: actions/checkout@v4 # - name: Install latest stable # uses: actions-rs/toolchain@v1 # with: diff --git a/.github/workflows/release_on_v_tag.yml b/.github/workflows/release_on_v_tag.yml index ddc24ec..40bda70 100644 --- a/.github/workflows/release_on_v_tag.yml +++ b/.github/workflows/release_on_v_tag.yml @@ -38,7 +38,7 @@ jobs: asset_name: windows_BoilR.exe strip: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies if: ${{ matrix.os == 'ubuntu-latest'}} run: | diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index 340b35b..7713a60 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -28,7 +28,7 @@ jobs: actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust toolchain uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 @@ -49,7 +49,7 @@ jobs: continue-on-error: true - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v2 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true diff --git a/src/platforms/egs/epic_ui.rs b/src/platforms/egs/epic_ui.rs index 4cb6ff9..ab7ece6 100644 --- a/src/platforms/egs/epic_ui.rs +++ b/src/platforms/egs/epic_ui.rs @@ -13,7 +13,7 @@ impl EpicPlatform { }; egui::CollapsingHeader::new(safe_mode_header) - .id_source("Epic_Launcher_safe_launch") + .id_salt("Epic_Launcher_safe_launch") .show(ui, |ui| { ui.label("Some games must be started from the Epic Launcher, select those games below and BoilR will create shortcuts that opens the games through the Epic Launcher."); let manifests =self.epic_manifests.get_or_insert_with(||{ diff --git a/src/platforms/heroic/heroic_platform.rs b/src/platforms/heroic/heroic_platform.rs index c64155c..8030dda 100644 --- a/src/platforms/heroic/heroic_platform.rs +++ b/src/platforms/heroic/heroic_platform.rs @@ -244,7 +244,7 @@ impl GamesPlatform for HeroicPlatform { (true, x) => format!("{x} games forced to launch directly"), }; - egui::CollapsingHeader::new(safe_mode_header).id_source("Heroic_Launcher_safe_launch").show(ui, |ui| { + egui::CollapsingHeader::new(safe_mode_header).id_salt("Heroic_Launcher_safe_launch").show(ui, |ui| { if self.settings.default_launch_through_heroic{ ui.label("Some games work best when launched directly, select those games below and BoilR will create shortcuts that launch the games directly."); } else { diff --git a/src/platforms/itch/butler_db_parser.rs b/src/platforms/itch/butler_db_parser.rs index 9f0ac24..2c6d916 100644 --- a/src/platforms/itch/butler_db_parser.rs +++ b/src/platforms/itch/butler_db_parser.rs @@ -38,15 +38,13 @@ fn parse_path(i: &[u8]) -> nom::IResult<&[u8], DbPaths> { let candidates = serde_json::from_str::>(&candidates_json); match candidates { - Ok(candidates) => { - return IResult::Ok(( - i, - DbPaths { - base_path, - paths: candidates.iter().map(|c| c.path.clone()).collect(), - }, - )) - } + Ok(candidates) => IResult::Ok(( + i, + DbPaths { + base_path, + paths: candidates.iter().map(|c| c.path.clone()).collect(), + }, + )), Err(_err) => { //we found a basepath, but no executables IResult::Ok(( diff --git a/src/platforms/lutris/game_list_parser.rs b/src/platforms/lutris/game_list_parser.rs index b1a66d4..fde926a 100644 --- a/src/platforms/lutris/game_list_parser.rs +++ b/src/platforms/lutris/game_list_parser.rs @@ -1,11 +1,7 @@ use super::lutris_game::LutrisGame; pub fn parse_lutris_games(input: &str) -> Vec { - let games = serde_json::from_str::>(input); - match games { - Ok(games) => games, - Err(_err) => Vec::new(), - } + serde_json::from_str::>(input).unwrap_or_default() } #[cfg(test)] diff --git a/src/platforms/uplay/mod.rs b/src/platforms/uplay/mod.rs index f8e7fe0..332b935 100644 --- a/src/platforms/uplay/mod.rs +++ b/src/platforms/uplay/mod.rs @@ -3,4 +3,3 @@ mod platform; mod settings; pub use platform::UplayPlatform; -pub use settings::UplaySettings; diff --git a/src/steam/utils.rs b/src/steam/utils.rs index d7d3f3f..92525e5 100644 --- a/src/steam/utils.rs +++ b/src/steam/utils.rs @@ -90,11 +90,11 @@ pub fn get_shortcuts_paths(settings: &SteamSettings) -> eyre::Result { } 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, diff --git a/src/steamgriddb/downloader.rs b/src/steamgriddb/downloader.rs index ac98188..d3d2255 100644 --- a/src/steamgriddb/downloader.rs +++ b/src/steamgriddb/downloader.rs @@ -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>, @@ -388,10 +388,10 @@ async fn get_steam_image_url(game_id: usize, image_type: &ImageType) -> Option Option { 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())); } } } diff --git a/src/ui/components/steam_user_select.rs b/src/ui/components/steam_user_select.rs index 4b28ef2..0489892 100644 --- a/src/ui/components/steam_user_select.rs +++ b/src/ui/components/steam_user_select.rs @@ -26,6 +26,6 @@ pub fn render_user_select<'a>( None } } else { - return steam_users.first(); + steam_users.first() } } diff --git a/src/ui/images/image_select_state.rs b/src/ui/images/image_select_state.rs index ba62c61..aedbb3f 100644 --- a/src/ui/images/image_select_state.rs +++ b/src/ui/images/image_select_state.rs @@ -1,7 +1,6 @@ - use steam_shortcuts_util::shortcut::ShortcutOwned; -use crate::{steam::SteamUsersInfo, steamgriddb::ImageType, ui::FetcStatus}; +use crate::{steam::SteamUsersInfo, steamgriddb::ImageType, ui::FetchStatus}; use super::{ gamemode::GameMode, possible_image::PossibleImage, gametype::GameType}; @@ -18,7 +17,7 @@ pub struct ImageSelectState { pub user_shortcuts: Option>, pub game_mode: GameMode, pub image_type_selected: Option, - pub image_options: Receiver>>, + pub image_options: Receiver>>, pub steam_games: Option>, pub possible_names: Option>, @@ -38,9 +37,8 @@ impl Default for ImageSelectState { game_mode: GameMode::Shortcuts, image_type_selected: Default::default(), possible_names: None, - image_options: watch::channel(FetcStatus::NeedsFetched).1, + image_options: watch::channel(FetchStatus::NeedsFetched).1, steam_games: None, } } } - diff --git a/src/ui/images/pages/pick_new_image.rs b/src/ui/images/pages/pick_new_image.rs index 9d27d53..d2e4aea 100644 --- a/src/ui/images/pages/pick_new_image.rs +++ b/src/ui/images/pages/pick_new_image.rs @@ -11,7 +11,7 @@ use crate::{ constants::MAX_WIDTH, hasimagekey::HasImageKey, image_select_state::ImageSelectState, possible_image::PossibleImage, useraction::UserAction, }, - FetcStatus, MyEguiApp, + FetchStatus, MyEguiApp, }, }; @@ -51,7 +51,7 @@ pub fn render_page_pick_image( let columns = (width / (column_width + column_padding)).floor() as u32; let mut column = 0; match &*state.image_options.borrow() { - FetcStatus::Fetched(images) => { + FetchStatus::Fetched(images) => { let x = Grid::new("ImageThumbnailSelectGrid") .spacing([column_padding, column_padding]) .show(ui, |ui| { @@ -128,7 +128,7 @@ pub fn handle_image_selected(app: &mut MyEguiApp, image: PossibleImage) { { app.image_selected_state.image_type_selected = None; - app.image_selected_state.image_options = watch::channel(FetcStatus::NeedsFetched).1; + app.image_selected_state.image_options = watch::channel(FetchStatus::NeedsFetched).1; } } } diff --git a/src/ui/images/ui_image_download.rs b/src/ui/images/ui_image_download.rs index 23219b8..5ab94e7 100644 --- a/src/ui/images/ui_image_download.rs +++ b/src/ui/images/ui_image_download.rs @@ -19,7 +19,7 @@ use crate::{ steam::{get_installed_games, SteamUsersInfo}, steamgriddb::{get_image_extension, get_query_type, ImageType}, sync::{download_images, SyncProgress}, - ui::{components::render_user_select, FetcStatus, MyEguiApp}, + ui::{components::render_user_select, FetchStatus, MyEguiApp}, }; use egui::ScrollArea; use futures::executor::block_on; @@ -274,7 +274,7 @@ impl MyEguiApp { fn handle_image_type_selected(&mut self, image_type: ImageType) { let state = &mut self.image_selected_state; state.image_type_selected = Some(image_type); - let (tx, rx) = watch::channel(FetcStatus::Fetching); + let (tx, rx) = watch::channel(FetchStatus::Fetching); self.image_selected_state.image_options = rx; let settings = self.settings.clone(); if let Some(auth_key) = settings.steamgrid_db.auth_key { @@ -298,7 +298,7 @@ impl MyEguiApp { full_url: possible_image.url.clone(), }); } - let _ = tx.send(FetcStatus::Fetched(result)); + let _ = tx.send(FetchStatus::Fetched(result)); } }); } diff --git a/src/ui/ui_disconnect.rs b/src/ui/ui_disconnect.rs index 98648d7..098107f 100644 --- a/src/ui/ui_disconnect.rs +++ b/src/ui/ui_disconnect.rs @@ -9,7 +9,7 @@ use crate::sync::disconnect_shortcut; use crate::sync::IsBoilRShortcut; #[derive(Default)] -pub struct DiconnectState { +pub struct DisconnectState { pub connected_shortcuts: Option, String>>, } @@ -17,7 +17,7 @@ impl MyEguiApp { pub fn render_disconnect(&mut self, ui: &mut egui::Ui) { let steam_settings = self.settings.steam.clone(); let users_info = self - .disconect_state + .disconnect_state .connected_shortcuts .get_or_insert_with(|| { let users = get_shortcuts_paths(&steam_settings) @@ -56,7 +56,7 @@ impl MyEguiApp { for user in users.iter_mut() { if has_multiple_users { - ui.heading(&user.path.to_string_lossy().to_string()); + ui.heading(user.path.to_string_lossy().to_string()); } for shortcut in user.shortcuts.iter() { if shortcut.is_boilr_shortcut() @@ -69,7 +69,7 @@ impl MyEguiApp { } }); if redraw != 0 { - self.disconect_state.connected_shortcuts = None; + self.disconnect_state.connected_shortcuts = None; self.settings.blacklisted_games.push(redraw); } } diff --git a/src/ui/ui_import_games.rs b/src/ui/ui_import_games.rs index c5fa889..a29c057 100644 --- a/src/ui/ui_import_games.rs +++ b/src/ui/ui_import_games.rs @@ -22,18 +22,18 @@ use super::{ const SECTION_SPACING: f32 = 25.0; -pub enum FetcStatus { +pub enum FetchStatus { NeedsFetched, Fetching, Fetched(T), } -impl FetcStatus { +impl FetchStatus { pub fn is_some(&self) -> bool { match self { - FetcStatus::NeedsFetched => false, - FetcStatus::Fetching => false, - FetcStatus::Fetched(_) => true, + FetchStatus::NeedsFetched => false, + FetchStatus::Fetching => false, + FetchStatus::Fetched(_) => true, } } } @@ -58,14 +58,14 @@ impl MyEguiApp { for (name,status) in &self.games_to_sync{ ui.heading(name); match &*status.borrow(){ - FetcStatus::NeedsFetched => {ui.label("Need to find games");}, - FetcStatus::Fetching => { + FetchStatus::NeedsFetched => {ui.label("Need to find games");}, + FetchStatus::Fetching => { ui.horizontal(|ui|{ ui.spinner(); ui.label("Finding installed games"); }); }, - FetcStatus::Fetched(shortcuts) => { + FetchStatus::Fetched(shortcuts) => { match shortcuts{ Ok(shortcuts) => { if shortcuts.is_empty(){ diff --git a/src/ui/uiapp.rs b/src/ui/uiapp.rs index 5f777ca..546df75 100644 --- a/src/ui/uiapp.rs +++ b/src/ui/uiapp.rs @@ -23,8 +23,8 @@ use super::{ TEXT_COLOR, }, ui_images::get_logo_icon, - ui_import_games::FetcStatus, - BackupState, DiconnectState, + ui_import_games::FetchStatus, + BackupState, DisconnectState, }; const SECTION_SPACING: f32 = 25.0; @@ -32,7 +32,7 @@ const SECTION_SPACING: f32 = 25.0; type GamesToSync = Vec<( String, - Receiver>>>, + Receiver>>>, )>; pub(crate) fn all_ready(games: &GamesToSync) -> bool { @@ -43,7 +43,7 @@ pub(crate) fn get_all_games(games: &GamesToSync) -> Vec<(String, Vec, pub(crate) image_selected_state: ImageSelectState, pub(crate) backup_state: BackupState, - pub(crate) disconect_state: DiconnectState, + pub(crate) disconnect_state: DisconnectState, pub(crate) rename_map: HashMap, pub(crate) current_edit: Option, pub(crate) platforms: Platforms, @@ -80,7 +80,7 @@ impl MyEguiApp { status_reciever: watch::channel(SyncProgress::NotStarted).1, image_selected_state: ImageSelectState::default(), backup_state: BackupState::default(), - disconect_state: DiconnectState::default(), + disconnect_state: DisconnectState::default(), rename_map: get_rename_map(), current_edit: Option::None, platforms, @@ -160,13 +160,13 @@ fn create_games_to_sync(rt: &mut Runtime, platforms: &[Box]) let mut to_sync = vec![]; for platform in platforms { if platform.enabled() { - let (tx, rx) = watch::channel(FetcStatus::NeedsFetched); + let (tx, rx) = watch::channel(FetchStatus::NeedsFetched); to_sync.push((platform.name().to_string(), rx)); let platform = platform.clone(); rt.spawn_blocking(move || { - let _ = tx.send(FetcStatus::Fetching); + let _ = tx.send(FetchStatus::Fetching); let games_to_sync = sync::get_platform_shortcuts(platform); - let _ = tx.send(FetcStatus::Fetched(games_to_sync)); + let _ = tx.send(FetchStatus::Fetched(games_to_sync)); }); } }