diff --git a/src/platforms/playnite/playnite_platform.rs b/src/platforms/playnite/playnite_platform.rs index 3f10461..9df7fce 100644 --- a/src/platforms/playnite/playnite_platform.rs +++ b/src/platforms/playnite/playnite_platform.rs @@ -86,7 +86,7 @@ impl PlaynitePlatform { fn get_playnite_games(&self) -> eyre::Result> { let mut res = vec![]; let (launcher_path, games_file_path) = self.find_paths()?; - let games_bytes = std::fs::read(&games_file_path).map_err(|e| match e.raw_os_error() { + let games_bytes = std::fs::read(games_file_path).map_err(|e| match e.raw_os_error() { Some(32) => { eyre::format_err!("It looks like Playnite is running and preventing BoilR from reading its database, please ensure that Playnite closed.") } @@ -123,7 +123,6 @@ impl PlaynitePlatform { return Err(eyre::eyre!("Did not find Playnite installation")); } let app_data_path = env::var("APPDATA")?; - let launcher_path = launcher_path; let playnite_folder = Path::new(&app_data_path).join("Playnite"); let games_file_path = playnite_folder.join("library").join("games.db"); Ok((launcher_path, games_file_path)) diff --git a/src/steam/utils.rs b/src/steam/utils.rs index ff07b0a..d7d3f3f 100644 --- a/src/steam/utils.rs +++ b/src/steam/utils.rs @@ -69,7 +69,6 @@ pub fn get_shortcuts_paths(settings: &SteamSettings) -> eyre::Result CachedSearch<'a> { } println!("Searching for {}", query.as_ref()); let search = self.client.search(query.as_ref()).await?; - let first_id = search.get(0).map(|f| f.id); + let first_id = search.first().map(|f| f.id); match first_id { Some(assumed_id) => { self.search_map.insert(app_id, (query.into(), assumed_id)); diff --git a/src/ui/components/steam_user_select.rs b/src/ui/components/steam_user_select.rs index 692321e..4b28ef2 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.get(0); + return steam_users.first(); } } diff --git a/src/ui/images/pages/pick_new_image.rs b/src/ui/images/pages/pick_new_image.rs index 2f69d0f..9d27d53 100644 --- a/src/ui/images/pages/pick_new_image.rs +++ b/src/ui/images/pages/pick_new_image.rs @@ -55,25 +55,24 @@ pub fn render_page_pick_image( let x = Grid::new("ImageThumbnailSelectGrid") .spacing([column_padding, column_padding]) .show(ui, |ui| { - for image in images { - if { - let url: &str = &image.thumbnail_url; - let image = egui::Image::new(url) - .max_width(column_width) - .shrink_to_fit(); - let calced = image.calc_size( - egui::Vec2 { - x: column_width, - y: f32::INFINITY, - }, - image.size(), - ); - let button = ImageButton::new(image); - ui.add_sized(calced, button) - .on_hover_text("Pick image") - .clicked() - } { - return Some(image.clone()); + for possible_image in images { + let image = egui::Image::new(&possible_image.thumbnail_url) + .max_width(column_width) + .shrink_to_fit(); + let calced = image.calc_size( + egui::Vec2 { + x: column_width, + y: f32::INFINITY, + }, + image.size(), + ); + let button = ImageButton::new(image); + let clicked = ui + .add_sized(calced, button) + .on_hover_text("Pick image") + .clicked(); + if clicked { + return Some(possible_image); } column += 1; if column >= columns { @@ -85,7 +84,7 @@ pub fn render_page_pick_image( }) .inner; if let Some(x) = x { - return Some(UserAction::ImageSelected(x)); + return Some(UserAction::ImageSelected(x.clone())); } } _ => { diff --git a/src/ui/images/ui_image_download.rs b/src/ui/images/ui_image_download.rs index 7ff321c..23219b8 100644 --- a/src/ui/images/ui_image_download.rs +++ b/src/ui/images/ui_image_download.rs @@ -279,8 +279,6 @@ impl MyEguiApp { let settings = self.settings.clone(); if let Some(auth_key) = settings.steamgrid_db.auth_key { if let Some(grid_id) = self.image_selected_state.grid_id { - let auth_key = auth_key; - let image_type = image_type; self.rt.spawn_blocking(move || { let thumbnails_folder = get_thumbnails_folder(); let client = steamgriddb_api::Client::new(auth_key); diff --git a/src/ui/uiapp.rs b/src/ui/uiapp.rs index 9c5db95..7e5eeac 100644 --- a/src/ui/uiapp.rs +++ b/src/ui/uiapp.rs @@ -322,11 +322,8 @@ pub fn run_ui(args: Vec) -> eyre::Result<()> { let app = MyEguiApp::new()?; let no_v_sync = args.contains(&"--no-vsync".to_string()); let fullscreen = is_fullscreen(&args); - - let mut viewport = egui::ViewportBuilder::default(); - viewport.fullscreen = Some(fullscreen); let logo = get_logo_icon(); - viewport.icon = Some(logo.into()); + let viewport = egui::ViewportBuilder { fullscreen: Some(fullscreen), icon: Some(logo.into()), ..Default::default() }; let native_options = eframe::NativeOptions { viewport, vsync: !no_v_sync,