refactor(downloads): Ran cargo clippy & moved DownloadManagerInterface

Created file "download_manager_interface.rs" to contain the DownloadManagerInterface

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-13 21:05:25 +11:00
parent a1ada07690
commit 075d6ecf3c
7 changed files with 151 additions and 127 deletions

View File

@ -1,7 +1,5 @@
use std::sync::{Arc, Mutex};
use std::sync::Mutex;
use log::info;
use rayon::spawn;
use crate::{AppState};
@ -45,10 +43,7 @@ pub fn get_game_download_progress(
Ok(progress.get_progress())
*/
let progress = match state.lock().unwrap().download_manager.get_current_game_download_progress() {
Some(progress) => progress,
None => 0.0
};
let progress = state.lock().unwrap().download_manager.get_current_game_download_progress().unwrap_or(0.0);
Ok(progress)
}