mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Fix typo in get_backups_flder and remove unnecessary parentheses (#458)
Rename get_backups_flder() to get_backups_folder() in config.rs and update all call sites. Also remove unnecessary parentheses around cast expression in write_shortcut_collections. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
ecb18d7192
commit
dba6707c3f
+1
-1
@@ -41,7 +41,7 @@ pub fn get_cache_file() -> PathBuf {
|
|||||||
get_config_folder().join("cache.json")
|
get_config_folder().join("cache.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_backups_flder() -> PathBuf {
|
pub fn get_backups_folder() -> PathBuf {
|
||||||
let backups_path = get_config_folder().join("backup");
|
let backups_path = get_config_folder().join("backup");
|
||||||
let _ = create_dir_all(&backups_path);
|
let _ = create_dir_all(&backups_path);
|
||||||
backups_path
|
backups_path
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ fn write_shortcut_collections<S: AsRef<str>>(
|
|||||||
let mut collections = vec![];
|
let mut collections = vec![];
|
||||||
|
|
||||||
for (name, shortcuts) in platform_results {
|
for (name, shortcuts) in platform_results {
|
||||||
let game_ids = shortcuts.iter().map(|s| (s.app_id as usize)).collect();
|
let game_ids = shortcuts.iter().map(|s| s.app_id as usize).collect();
|
||||||
collections.push(Collection {
|
collections.push(Collection {
|
||||||
name: name.clone(),
|
name: name.clone(),
|
||||||
game_ids,
|
game_ids,
|
||||||
|
|||||||
+3
-3
@@ -4,7 +4,7 @@ use egui::ScrollArea;
|
|||||||
use time::format_description;
|
use time::format_description;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::get_backups_flder,
|
config::get_backups_folder,
|
||||||
steam::{get_shortcuts_paths, SteamSettings},
|
steam::{get_shortcuts_paths, SteamSettings},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ pub fn restore_backup(steam_settings: &SteamSettings, shortcut_path: &Path) -> b
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_backups() -> Vec<PathBuf> {
|
pub fn load_backups() -> Vec<PathBuf> {
|
||||||
let backup_folder = get_backups_flder();
|
let backup_folder = get_backups_folder();
|
||||||
let files = std::fs::read_dir(backup_folder);
|
let files = std::fs::read_dir(backup_folder);
|
||||||
let mut result = vec![];
|
let mut result = vec![];
|
||||||
if let Ok(files) = files {
|
if let Ok(files) = files {
|
||||||
@@ -113,7 +113,7 @@ const DATE_FORMAT: &str = "[year]-[month]-[day]-[hour]-[minute]-[second]";
|
|||||||
pub fn backup_shortcuts(steam_settings: &SteamSettings) {
|
pub fn backup_shortcuts(steam_settings: &SteamSettings) {
|
||||||
use time::OffsetDateTime;
|
use time::OffsetDateTime;
|
||||||
|
|
||||||
let backup_folder = get_backups_flder();
|
let backup_folder = get_backups_folder();
|
||||||
let paths = get_shortcuts_paths(steam_settings);
|
let paths = get_shortcuts_paths(steam_settings);
|
||||||
let date = OffsetDateTime::now_utc();
|
let date = OffsetDateTime::now_utc();
|
||||||
let format = format_description::parse(DATE_FORMAT);
|
let format = format_description::parse(DATE_FORMAT);
|
||||||
|
|||||||
Reference in New Issue
Block a user