Inline print variables (#328)

* Inline format messages

* Cargo auto fixes
This commit is contained in:
Philip Kristoffersen
2023-02-02 21:33:42 +01:00
committed by GitHub
parent e92196e701
commit 27b429adcd
24 changed files with 61 additions and 72 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ pub fn migrate_config() {
if old_path.exists() { if old_path.exists() {
println!("Migrating from configuration version 0 to version 1"); println!("Migrating from configuration version 0 to version 1");
let new_path = crate::config::get_config_file(); let new_path = crate::config::get_config_file();
println!("Your configuration file will be moved to {:?}", new_path); println!("Your configuration file will be moved to {new_path:?}");
let _ = std::fs::copy(old_path, new_path); let _ = std::fs::copy(old_path, new_path);
let _ = std::fs::remove_file(old_path); let _ = std::fs::remove_file(old_path);
} }
@@ -39,7 +39,7 @@ pub fn migrate_config() {
settings.config_version = Some(1); settings.config_version = Some(1);
let platforms = get_platforms(); let platforms = get_platforms();
if let Err(err) = save_settings(&settings, &platforms){ if let Err(err) = save_settings(&settings, &platforms){
eprintln!("Failed to load settings {:?}", err); eprintln!("Failed to load settings {err:?}");
} }
} }
} }
+1 -1
View File
@@ -9,7 +9,7 @@ impl EpicPlatform {
let safe_mode_header = match epic_settings.safe_launch.len() { let safe_mode_header = match epic_settings.safe_launch.len() {
0 => "Force games to launch through Epic Launcher".to_string(), 0 => "Force games to launch through Epic Launcher".to_string(),
1 => "One game forced to launch through Epic Launcher".to_string(), 1 => "One game forced to launch through Epic Launcher".to_string(),
x => format!("{} games forced to launch through Epic Launcher", x), x => format!("{x} games forced to launch through Epic Launcher"),
}; };
egui::CollapsingHeader::new(safe_mode_header) egui::CollapsingHeader::new(safe_mode_header)
+5 -5
View File
@@ -53,12 +53,12 @@ fn exe_shortcut(manifest: ManifestItem) -> ShortcutOwned {
let start_dir = start_dir.trim_matches('\"'); let start_dir = start_dir.trim_matches('\"');
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
let start_dir_string = format!("\"{}\"", start_dir); let start_dir_string = format!("\"{start_dir}\"");
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
let start_dir = start_dir_string.as_str(); let start_dir = start_dir_string.as_str();
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
let exe_string = format!("\"{}\"", exe); let exe_string = format!("\"{exe}\"");
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
let exe = exe_string.as_str(); let exe = exe_string.as_str();
@@ -105,7 +105,7 @@ fn launcher_shortcut(manifest: ManifestItem) -> ShortcutOwned {
.unwrap_or_default(); .unwrap_or_default();
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
let parent_folder = format!("\"{}\"", parent_folder); let parent_folder = format!("\"{parent_folder}\"");
let launcher_path = manifest let launcher_path = manifest
.launcher_path .launcher_path
@@ -114,7 +114,7 @@ fn launcher_shortcut(manifest: ManifestItem) -> ShortcutOwned {
.unwrap_or_default(); .unwrap_or_default();
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
let launcher_path = format!("\"{}\"", launcher_path); let launcher_path = format!("\"{launcher_path}\"");
Shortcut::new( Shortcut::new(
"0", "0",
@@ -149,7 +149,7 @@ impl ManifestItem {
.join(&manifest.launch_executable) .join(&manifest.launch_executable)
.to_string_lossy() .to_string_lossy()
.to_string(); .to_string();
let exe = format!("\"{}\"", exe_path); let exe = format!("\"{exe_path}\"");
exe exe
} }
+2 -2
View File
@@ -48,12 +48,12 @@ impl From<GogShortcut> for ShortcutOwned {
}; };
let mut exe_string = exe.to_string_lossy().to_string(); let mut exe_string = exe.to_string_lossy().to_string();
if exe_string.contains(' ') && !exe_string.starts_with('\"') { if exe_string.contains(' ') && !exe_string.starts_with('\"') {
exe_string = format!("\"{}\"", exe_string); exe_string = format!("\"{exe_string}\"");
} }
let mut working_dir_string = gogs.working_dir; let mut working_dir_string = gogs.working_dir;
if working_dir_string.contains(' ') && !working_dir_string.starts_with('\"') { if working_dir_string.contains(' ') && !working_dir_string.starts_with('\"') {
working_dir_string = format!("\"{}\"", working_dir_string); working_dir_string = format!("\"{working_dir_string}\"");
} }
let shortcut = Shortcut::new( let shortcut = Shortcut::new(
+2 -2
View File
@@ -29,7 +29,7 @@ impl From<HeroicGame> for ShortcutOwned {
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
{ {
if !target.starts_with('\"') && !target.ends_with('\"') { if !target.starts_with('\"') && !target.ends_with('\"') {
target = format!("\"{}\"", target); target = format!("\"{target}\"");
} }
} }
@@ -38,7 +38,7 @@ impl From<HeroicGame> for ShortcutOwned {
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
{ {
if !install_path.starts_with('\"') && !install_path.ends_with('\"') { if !install_path.starts_with('\"') && !install_path.ends_with('\"') {
install_path = format!("\"{}\"", install_path); install_path = format!("\"{install_path}\"");
} }
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
+2 -3
View File
@@ -51,13 +51,12 @@ impl From<HeroicGameType> for ShortcutOwned {
app_name, app_name,
install_mode, install_mode,
} => { } => {
let launch_parameter = format!("heroic://launch/{}", app_name); let launch_parameter = format!("heroic://launch/{app_name}");
let (exe, parameter) = match install_mode { let (exe, parameter) = match install_mode {
InstallationMode::FlatPak => ( InstallationMode::FlatPak => (
"flatpak", "flatpak",
format!( format!(
"run com.heroicgameslauncher.hgl {} --no-gui --no-sandbox", "run com.heroicgameslauncher.hgl {launch_parameter} --no-gui --no-sandbox"
launch_parameter
), ),
), ),
InstallationMode::UserBin => ("heroic", launch_parameter), InstallationMode::UserBin => ("heroic", launch_parameter),
+2 -2
View File
@@ -237,11 +237,11 @@ impl GamesPlatform for HeroicPlatform {
) { ) {
(false, 0) => "Force games to launch through Heroic Launcher".to_string(), (false, 0) => "Force games to launch through Heroic Launcher".to_string(),
(false, 1) => "One game forced to launch through Heroic Launcher".to_string(), (false, 1) => "One game forced to launch through Heroic Launcher".to_string(),
(false, x) => format!("{} games forced to launch through Heroic Launcher", x), (false, x) => format!("{x} games forced to launch through Heroic Launcher"),
(true, 0) => "Force games to launch directly".to_string(), (true, 0) => "Force games to launch directly".to_string(),
(true, 1) => "One game forced to launch directly".to_string(), (true, 1) => "One game forced to launch directly".to_string(),
(true, x) => format!("{} games forced to launch directly", x), (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_source("Heroic_Launcher_safe_launch").show(ui, |ui| {
+1 -1
View File
@@ -79,7 +79,7 @@ fn dbpath_to_game(paths: &DbPaths) -> Option<ItchGame> {
pub fn get_default_location() -> String { pub fn get_default_location() -> String {
//If we don't have a home drive we have to just die //If we don't have a home drive we have to just die
let home = std::env::var("HOME").unwrap_or_default(); let home = std::env::var("HOME").unwrap_or_default();
format!("{}/.config/itch/", home) format!("{home}/.config/itch/")
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
+2 -3
View File
@@ -84,8 +84,7 @@ pub fn get_platforms() -> Platforms {
Ok(s) => s, Ok(s) => s,
Err(err) => { Err(err) => {
eprintln!( eprintln!(
"Could not load platform settings, using defaults: Error: {:?}", "Could not load platform settings, using defaults: Error: {err:?}"
err
); );
HashMap::new() HashMap::new()
} }
@@ -113,7 +112,7 @@ where
Ok(k) => k, Ok(k) => k,
Err(err) => { Err(err) => {
if !str.is_empty() { if !str.is_empty() {
eprintln!("Error reading settings file {:?}", err); eprintln!("Error reading settings file {err:?}");
} }
Setting::default() Setting::default()
} }
+1 -1
View File
@@ -30,7 +30,7 @@ impl Settings {
// Add in the current environment file // Add in the current environment file
// Default to 'development' env // Default to 'development' env
// Note that this file is _optional_ // Note that this file is _optional_
.add_source(File::with_name(&format!("config/{}", env)).required(false)) .add_source(File::with_name(&format!("config/{env}")).required(false))
// Add in a local configuration file // Add in a local configuration file
// This file shouldn't be checked in to git // This file shouldn't be checked in to git
.add_source(File::with_name("local.toml").required(false)) .add_source(File::with_name("local.toml").required(false))
+5 -5
View File
@@ -62,7 +62,7 @@ impl ActualSteamCollection {
pub fn is_boilr_collection(&self) -> bool { pub fn is_boilr_collection(&self) -> bool {
self.key self.key
.contains(&format!("user-collections.{}", BOILR_TAG)) .contains(&format!("user-collections.{BOILR_TAG}"))
} }
} }
@@ -215,7 +215,7 @@ fn save_category<S: AsRef<str>>(
batch: &mut WriteBatch, batch: &mut WriteBatch,
) -> Result<(), Box<dyn Error>> { ) -> Result<(), Box<dyn Error>> {
let json = serde_json::to_string(&category)?; let json = serde_json::to_string(&category)?;
let prefixed = format!("\u{1}{}", json); let prefixed = format!("\u{1}{json}");
batch.put(category_key.as_ref().as_bytes(), prefixed.as_bytes()); batch.put(category_key.as_ref().as_bytes(), prefixed.as_bytes());
Ok(()) Ok(())
} }
@@ -260,7 +260,7 @@ fn open_db() -> eyre::Result<DB> {
fn get_namespace_keys<S: AsRef<str>>(steamid: S, db: &mut DB) -> HashSet<String> { fn get_namespace_keys<S: AsRef<str>>(steamid: S, db: &mut DB) -> HashSet<String> {
let keyprefix = get_steam_user_prefix(steamid); let keyprefix = get_steam_user_prefix(steamid);
let namespaces_key = format!("{}s", keyprefix); let namespaces_key = format!("{keyprefix}s");
let key_bytes = namespaces_key.as_bytes(); let key_bytes = namespaces_key.as_bytes();
let namespaces = get_namespaces(db, key_bytes).unwrap_or_default(); let namespaces = get_namespaces(db, key_bytes).unwrap_or_default();
let namespace_keys = namespaces let namespace_keys = namespaces
@@ -330,7 +330,7 @@ fn name_to_key<S: AsRef<str>>(name: S) -> String {
} else { } else {
&base64 &base64
}; };
format!("{}-{}", BOILR_TAG, base64_no_end) format!("{BOILR_TAG}-{base64_no_end}")
} }
fn parse_steam_collections<S: AsRef<str>>( fn parse_steam_collections<S: AsRef<str>>(
@@ -371,7 +371,7 @@ pub fn write_vdf_collection_to_string<S: AsRef<str>>(
input.get(..start_index_plus_key), input.get(..start_index_plus_key),
input.get(end_index_in_full..), input.get(end_index_in_full..),
) { ) {
let result = format!("{}{}{}", before, encoded_json, after); let result = format!("{before}{encoded_json}{after}");
return Some(result); return Some(result);
} }
} }
+1 -1
View File
@@ -52,7 +52,7 @@ fn enable_proton_games<S: AsRef<str>, B: AsRef<str>>(vdf_content: S, games: &[B]
if let Some(before_section) = vdf_content.get(..section_info.start) { if let Some(before_section) = vdf_content.get(..section_info.start) {
if let Some(after_section) = vdf_content.get(section_info.end..) { if let Some(after_section) = vdf_content.get(section_info.end..) {
return format!("{}{}{}", before_section, new_section, after_section); return format!("{before_section}{new_section}{after_section}");
} }
} }
} }
+1 -1
View File
@@ -51,7 +51,7 @@ pub fn ensure_steam_started(_settings: &super::SteamSettings) {
println!("Starting steam"); println!("Starting steam");
let mut command = Command::new(steam_name); let mut command = Command::new(steam_name);
if let Err(e) = command.spawn() { if let Err(e) = command.spawn() {
println!("Failed to start steam: {:?}", e); println!("Failed to start steam: {e:?}");
}; };
} }
} }
+1 -1
View File
@@ -87,7 +87,7 @@ pub fn get_shortcuts_paths(settings: &SteamSettings) -> eyre::Result<Vec<SteamUs
let folder_str = folder_path let folder_str = folder_path
.to_str() .to_str()
.unwrap_or_default(); .unwrap_or_default();
let path = format!("{}//config//shortcuts.vdf", folder_str); let path = format!("{folder_str}//config//shortcuts.vdf");
let shortcuts_path = Path::new(path.as_str()); let shortcuts_path = Path::new(path.as_str());
let folder_string = folder_str.to_string(); let folder_string = folder_str.to_string();
if shortcuts_path.exists() { if shortcuts_path.exists() {
+1 -1
View File
@@ -20,7 +20,7 @@ impl<'a> CachedSearch<'a> {
pub fn save(&self) { pub fn save(&self) {
if let Err(err) = save_search_map(&self.search_map) { if let Err(err) = save_search_map(&self.search_map) {
eprintln!("Failed saving searchmap : {:?}", err); eprintln!("Failed saving searchmap : {err:?}");
} }
} }
+6 -7
View File
@@ -105,7 +105,7 @@ pub async fn download_images_for_users<'b>(
.collect::<Vec<()>>() .collect::<Vec<()>>()
.await; .await;
let duration = start_time.elapsed(); let duration = start_time.elapsed();
println!("Finished getting images in: {:?}", duration); println!("Finished getting images in: {duration:?}");
//Validate that the downloads where ok //Validate that the downloads where ok
for to_download in to_downloads { for to_download in to_downloads {
@@ -277,7 +277,7 @@ async fn search_for_images_to_download<T: SearchSettings>(
to_download.extend(download_for_this_type); to_download.extend(download_for_this_type);
} }
Err(err) => eprintln!("Error getting images: {}", err), Err(err) => eprintln!("Error getting images: {err}"),
} }
} }
} }
@@ -308,7 +308,7 @@ async fn get_images_for_ids(
let image_search_result = client.get_images_for_ids(image_ids, &query_type).await; let image_search_result = client.get_images_for_ids(image_ids, &query_type).await;
image_search_result.map_err(|e| format!("Image search failed {:?}", e)) image_search_result.map_err(|e| format!("Image search failed {e:?}"))
} }
const BIG_PICTURE_DIMS: [GridDimentions; 2] = [GridDimentions::D920x430, GridDimentions::D460x215]; const BIG_PICTURE_DIMS: [GridDimentions; 2] = [GridDimentions::D920x430, GridDimentions::D460x215];
@@ -374,7 +374,7 @@ async fn get_steam_image_url(game_id: usize, image_type: &ImageType) -> Option<S
return Some(url); return Some(url);
} }
} }
let steamgriddb_page_url = format!("https://www.steamgriddb.com/api/public/game/{}/", game_id); let steamgriddb_page_url = format!("https://www.steamgriddb.com/api/public/game/{game_id}/");
let response = reqwest::get(steamgriddb_page_url).await; let response = reqwest::get(steamgriddb_page_url).await;
if let Ok(response) = response { if let Ok(response) = response {
let text_response = response.json::<PublicGameResponse>().await; let text_response = response.json::<PublicGameResponse>().await;
@@ -398,7 +398,7 @@ async fn get_steam_image_url(game_id: usize, image_type: &ImageType) -> Option<S
} }
async fn get_steam_icon_url(game_id: usize) -> Option<String> { async fn get_steam_icon_url(game_id: usize) -> Option<String> {
let steamgriddb_page_url = format!("https://www.steamgriddb.com/api/public/game/{}/", game_id); let steamgriddb_page_url = format!("https://www.steamgriddb.com/api/public/game/{game_id}/");
let response = reqwest::get(steamgriddb_page_url).await; let response = reqwest::get(steamgriddb_page_url).await;
if let Ok(response) = response { if let Ok(response) = response {
let text_response = response.json::<PublicGameResponse>().await; let text_response = response.json::<PublicGameResponse>().await;
@@ -423,8 +423,7 @@ async fn get_steam_icon_url(game_id: usize) -> Option<String> {
fn icon_url(steam_app_id: &str, icon_id: &str) -> String { fn icon_url(steam_app_id: &str, icon_id: &str) -> String {
format!( format!(
"https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps/{}/{}.ico", "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps/{steam_app_id}/{icon_id}.ico"
steam_app_id, icon_id
) )
} }
+11 -16
View File
@@ -51,12 +51,12 @@ impl ImageType {
pub fn file_name_no_extension(&self, app_id: u32) -> String { pub fn file_name_no_extension(&self, app_id: u32) -> String {
match self { match self {
ImageType::Hero => format!("{}_hero", app_id), ImageType::Hero => format!("{app_id}_hero"),
ImageType::Grid => format!("{}p", app_id), ImageType::Grid => format!("{app_id}p"),
ImageType::WideGrid => format!("{}", app_id), ImageType::WideGrid => format!("{app_id}"),
ImageType::Logo => format!("{}_logo", app_id), ImageType::Logo => format!("{app_id}_logo"),
ImageType::BigPicture => format!("{}_bigpicture", app_id), ImageType::BigPicture => format!("{app_id}_bigpicture"),
ImageType::Icon => format!("{}-icon", app_id), ImageType::Icon => format!("{app_id}-icon"),
} }
} }
@@ -64,24 +64,19 @@ impl ImageType {
let steam_app_id = steam_app_id.as_ref(); let steam_app_id = steam_app_id.as_ref();
match self { match self {
ImageType::Hero => format!( ImageType::Hero => format!(
"https://cdn.cloudflare.steamstatic.com/steam/apps/{}/library_hero.jpg?t={}", "https://cdn.cloudflare.steamstatic.com/steam/apps/{steam_app_id}/library_hero.jpg?t={mtime}"
steam_app_id, mtime
), ),
ImageType::Grid => format!( ImageType::Grid => format!(
"https://cdn.cloudflare.steamstatic.com/steam/apps/{}/library_600x900_2x.jpg?t={}", "https://cdn.cloudflare.steamstatic.com/steam/apps/{steam_app_id}/library_600x900_2x.jpg?t={mtime}"
steam_app_id, mtime
), ),
ImageType::WideGrid => format!( ImageType::WideGrid => format!(
"https://cdn.cloudflare.steamstatic.com/steam/apps/{}/header.jpg?t={}", "https://cdn.cloudflare.steamstatic.com/steam/apps/{steam_app_id}/header.jpg?t={mtime}"
steam_app_id, mtime
), ),
ImageType::Logo => format!( ImageType::Logo => format!(
"https://cdn.cloudflare.steamstatic.com/steam/apps/{}/logo.png?t={}", "https://cdn.cloudflare.steamstatic.com/steam/apps/{steam_app_id}/logo.png?t={mtime}"
steam_app_id, mtime
), ),
ImageType::BigPicture => format!( ImageType::BigPicture => format!(
"https://cdn.cloudflare.steamstatic.com/steam/apps/{}/header.jpg?t={}", "https://cdn.cloudflare.steamstatic.com/steam/apps/{steam_app_id}/header.jpg?t={mtime}"
steam_app_id, mtime
), ),
// This should not happen // This should not happen
_ => "".to_string(), _ => "".to_string(),
+1 -2
View File
@@ -54,8 +54,7 @@ pub fn ensure_links_folder_created(name: &str) {
if !boilr_links_path.exists() { if !boilr_links_path.exists() {
if let Err(e) = std::fs::create_dir_all(&boilr_links_path) { if let Err(e) = std::fs::create_dir_all(&boilr_links_path) {
println!( println!(
"Could not create links folder for symlinks at path: {:?} , error: {:?} , you can try to disable creating symlinks for platform {}", "Could not create links folder for symlinks at path: {boilr_links_path:?} , error: {e:?} , you can try to disable creating symlinks for platform {name}"
boilr_links_path, e, name
); );
} }
} }
+1 -1
View File
@@ -115,7 +115,7 @@ pub fn sync_shortcuts(
} }
let duration = start_time.elapsed(); let duration = start_time.elapsed();
println!("Finished synchronizing games in: {:?}", duration); println!("Finished synchronizing games in: {duration:?}");
} }
Ok(userinfo_shortcuts) Ok(userinfo_shortcuts)
} }
+1 -1
View File
@@ -124,7 +124,7 @@ impl MyEguiApp {
match paths { match paths {
Ok(paths) => self.image_selected_state.steam_users = Some(paths), Ok(paths) => self.image_selected_state.steam_users = Some(paths),
Err(err) => { Err(err) => {
self.image_selected_state.settings_error = Some(format!("Could not find user steam location, error message: {} , try to clear the steam location field in settings to let BoilR find it itself",err)); self.image_selected_state.settings_error = Some(format!("Could not find user steam location, error message: {err} , try to clear the steam location field in settings to let BoilR find it itself"));
} }
} }
} }
+5 -7
View File
@@ -24,7 +24,7 @@ impl MyEguiApp {
ui.add_space(15.0); ui.add_space(15.0);
if let Some(last_restore) = self.backup_state.last_restore.as_ref() { if let Some(last_restore) = self.backup_state.last_restore.as_ref() {
ui.heading(format!("Last restored {:?}", last_restore)); ui.heading(format!("Last restored {last_restore:?}"));
} }
if ui.button("Click here to create a new backup").clicked() { if ui.button("Click here to create a new backup").clicked() {
@@ -70,12 +70,11 @@ pub fn restore_backup(steam_settings: &SteamSettings, shortcut_path: &Path) -> b
if file_name.to_string_lossy().starts_with(&user.user_id) { if file_name.to_string_lossy().starts_with(&user.user_id) {
match std::fs::copy(shortcut_path, Path::new(&user_shortcut_path)) { match std::fs::copy(shortcut_path, Path::new(&user_shortcut_path)) {
Ok(_) => { Ok(_) => {
println!("Restored shortcut to path : {}", user_shortcut_path); println!("Restored shortcut to path : {user_shortcut_path}");
} }
Err(err) => { Err(err) => {
eprintln!( eprintln!(
"Failed to restored shortcut to path : {} gave error: {:?}", "Failed to restored shortcut to path : {user_shortcut_path} gave error: {err:?}"
user_shortcut_path, err
); );
} }
} }
@@ -129,12 +128,11 @@ pub fn backup_shortcuts(steam_settings: &SteamSettings) {
)); ));
match std::fs::copy(shortcut_path, &new_path) { match std::fs::copy(shortcut_path, &new_path) {
Ok(_) => { Ok(_) => {
println!("Backed up shortcut at: {:?}", new_path); println!("Backed up shortcut at: {new_path:?}");
} }
Err(err) => { Err(err) => {
eprintln!( eprintln!(
"Failed to backup shortcut at: {:?}, error: {:?}", "Failed to backup shortcut at: {new_path:?}, error: {err:?}"
new_path, err
); );
} }
} }
+2 -2
View File
@@ -87,7 +87,7 @@ impl MyEguiApp {
let contents = serde_json::to_string(&self.rename_map); let contents = serde_json::to_string(&self.rename_map);
if let Ok(contents) = contents{ if let Ok(contents) = contents{
let res = std::fs::write(&rename_file_path, contents); let res = std::fs::write(&rename_file_path, contents);
println!("Write rename file at {:?} with result: {:?}",rename_file_path, res); println!("Write rename file at {rename_file_path:?} with result: {res:?}");
} }
} }
} }
@@ -212,7 +212,7 @@ where
} }
} }
if let Err(err) = setup_proton_games(&shortcuts_to_proton){ if let Err(err) = setup_proton_games(&shortcuts_to_proton){
eprintln!("failed to save proton settings: {:?}",err); eprintln!("failed to save proton settings: {err:?}");
} }
} }
} }
+1 -1
View File
@@ -34,7 +34,7 @@ impl MyEguiApp {
platform.render_ui(ui); platform.render_ui(ui);
ui.add_space(SECTION_SPACING); ui.add_space(SECTION_SPACING);
} }
ui.label(format!("Version: {}", VERSION)); ui.label(format!("Version: {VERSION}"));
}); });
} }
+4 -4
View File
@@ -97,11 +97,11 @@ impl MyEguiApp {
SyncProgress::NotStarted => ("".to_string(), false), SyncProgress::NotStarted => ("".to_string(), false),
SyncProgress::Starting => ("Starting Import".to_string(), true), SyncProgress::Starting => ("Starting Import".to_string(), true),
SyncProgress::FoundGames { games_found } => { SyncProgress::FoundGames { games_found } => {
(format!("Found {} games to import", games_found), true) (format!("Found {games_found} games to import"), true)
} }
SyncProgress::FindingImages => ("Searching for images".to_string(), true), SyncProgress::FindingImages => ("Searching for images".to_string(), true),
SyncProgress::DownloadingImages { to_download } => { SyncProgress::DownloadingImages { to_download } => {
(format!("Downloading {} images ", to_download), true) (format!("Downloading {to_download} images "), true)
} }
SyncProgress::Done => ("Done importing games".to_string(), false), SyncProgress::Done => ("Done importing games".to_string(), false),
}; };
@@ -129,7 +129,7 @@ impl MyEguiApp {
.clicked() .clicked()
{ {
if let Err(err) = save_settings(&self.settings, &self.platforms){ if let Err(err) = save_settings(&self.settings, &self.platforms){
eprintln!("Failed to save settings {:?}",err); eprintln!("Failed to save settings {err:?}");
} }
self.run_sync_async(); self.run_sync_async();
} }
@@ -269,7 +269,7 @@ impl App for MyEguiApp {
if ui.add(save_button).on_hover_text("Save settings").clicked() { if ui.add(save_button).on_hover_text("Save settings").clicked() {
if let Err(err) = save_settings(&self.settings, &self.platforms){ if let Err(err) = save_settings(&self.settings, &self.platforms){
eprintln!("Failed to save settings: {:?}",err); eprintln!("Failed to save settings: {err:?}");
} }
} }
}); });