summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a7a34ac..7287660 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -15,9 +15,10 @@ use error::{ErrorType, MLError, MLE};
15use indicatif::{ProgressStyle, ProgressBar}; 15use indicatif::{ProgressStyle, ProgressBar};
16use serde::{Deserialize, Serialize}; 16use serde::{Deserialize, Serialize};
17 17
18pub static STYLE_BAR_POS: &str = "{spinner:.green}{wide_msg}{pos}/{len} [{bar:.green/lime}]";
19pub static STYLE_BAR_BYTE: &str = "{spinner:.green}{wide_msg}{bytes}/{total_bytes} [{bar:.green/lime}]"; 18pub static STYLE_BAR_BYTE: &str = "{spinner:.green}{wide_msg}{bytes}/{total_bytes} [{bar:.green/lime}]";
19pub static STYLE_BAR_POS: &str = " {wide_msg}{pos}/{len} [{bar:.green/lime}]";
20pub static STYLE_SPINNER: &str = "{spinner:.green}{wide_msg}"; 20pub static STYLE_SPINNER: &str = "{spinner:.green}{wide_msg}";
21pub static STYLE_OPERATION: &str = " {wide_msg}";
21pub static STYLE_MESSAGE: &str = "{wide_msg}"; 22pub static STYLE_MESSAGE: &str = "{wide_msg}";
22pub static PROGRESS_CHARS: &str = "#>-"; 23pub static PROGRESS_CHARS: &str = "#>-";
23 24
@@ -70,7 +71,7 @@ pub async fn check_game_versions(path: &str, force: bool) -> MLE<()> {
70 71
71 let creation_time = fs::metadata(path)?.created()?; 72 let creation_time = fs::metadata(path)?.created()?;
72 if !force && creation_time.elapsed().unwrap() < Duration::from_secs(60 * 60 * 24) { return Ok(()); } 73 if !force && creation_time.elapsed().unwrap() < Duration::from_secs(60 * 60 * 24) { return Ok(()); }
73 std::io::stdout().flush()?; 74
74 let versions = get_game_versions().await; 75 let versions = get_game_versions().await;
75 remove_file(path)?; 76 remove_file(path)?;
76 let mut file = File::create(path)?; 77 let mut file = File::create(path)?;