diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -15,9 +15,10 @@ use error::{ErrorType, MLError, MLE}; | |||
15 | use indicatif::{ProgressStyle, ProgressBar}; | 15 | use indicatif::{ProgressStyle, ProgressBar}; |
16 | use serde::{Deserialize, Serialize}; | 16 | use serde::{Deserialize, Serialize}; |
17 | 17 | ||
18 | pub static STYLE_BAR_POS: &str = "{spinner:.green}{wide_msg}{pos}/{len} [{bar:.green/lime}]"; | ||
19 | pub static STYLE_BAR_BYTE: &str = "{spinner:.green}{wide_msg}{bytes}/{total_bytes} [{bar:.green/lime}]"; | 18 | pub static STYLE_BAR_BYTE: &str = "{spinner:.green}{wide_msg}{bytes}/{total_bytes} [{bar:.green/lime}]"; |
19 | pub static STYLE_BAR_POS: &str = " {wide_msg}{pos}/{len} [{bar:.green/lime}]"; | ||
20 | pub static STYLE_SPINNER: &str = "{spinner:.green}{wide_msg}"; | 20 | pub static STYLE_SPINNER: &str = "{spinner:.green}{wide_msg}"; |
21 | pub static STYLE_OPERATION: &str = " {wide_msg}"; | ||
21 | pub static STYLE_MESSAGE: &str = "{wide_msg}"; | 22 | pub static STYLE_MESSAGE: &str = "{wide_msg}"; |
22 | pub static PROGRESS_CHARS: &str = "#>-"; | 23 | pub 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)?; |