clippy/fmt: just fix applied
This commit is contained in:
@@ -150,17 +150,16 @@ fn run_game(id: String, state: tauri::State<LanSpreadState>) {
|
||||
}
|
||||
|
||||
fn set_game_install_state_from_path(game_db: &mut GameDB, path: &Path, installed: bool) {
|
||||
if let Some(file_name) = path.file_name() {
|
||||
if let Some(file_name) = file_name.to_str() {
|
||||
if let Some(game) = game_db.get_mut_game_by_id(file_name) {
|
||||
if installed {
|
||||
log::debug!("Game is installed: {game}");
|
||||
} else {
|
||||
log::error!("Game is missing: {game}");
|
||||
}
|
||||
game.installed = installed;
|
||||
}
|
||||
if let Some(file_name) = path.file_name()
|
||||
&& let Some(file_name) = file_name.to_str()
|
||||
&& let Some(game) = game_db.get_mut_game_by_id(file_name)
|
||||
{
|
||||
if installed {
|
||||
log::debug!("Game is installed: {game}");
|
||||
} else {
|
||||
log::error!("Game is missing: {game}");
|
||||
}
|
||||
game.installed = installed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,14 +212,13 @@ fn update_game_directory(app_handle: tauri::AppHandle, path: String) {
|
||||
|
||||
// update game_db with installed games from real game directory
|
||||
entries.into_iter().for_each(|entry| {
|
||||
if let Ok(entry) = entry {
|
||||
if let Ok(path_type) = entry.file_type() {
|
||||
if path_type.is_dir() {
|
||||
let path = entry.path();
|
||||
if path.join("version.ini").exists() {
|
||||
set_game_install_state_from_path(&mut game_db, &path, true);
|
||||
}
|
||||
}
|
||||
if let Ok(entry) = entry
|
||||
&& let Ok(path_type) = entry.file_type()
|
||||
&& path_type.is_dir()
|
||||
{
|
||||
let path = entry.path();
|
||||
if path.join("version.ini").exists() {
|
||||
set_game_install_state_from_path(&mut game_db, &path, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user