From c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Mon, 29 May 2023 18:01:12 +0200 Subject: cargo fmt and add fmt file --- src/lib.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index d76f8bf..f77befc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,7 +44,9 @@ impl Modloader { "forge" => Ok(Modloader::Forge), "fabric" => Ok(Modloader::Fabric), "quilt" => Ok(Modloader::Quilt), - _ => Err(MLError::new(ErrorType::ArgumentError, "UNKNOWN_MODLOADER")), + _ => { + Err(MLError::new(ErrorType::ArgumentError, "UNKNOWN_MODLOADER")) + } } } } @@ -76,7 +78,9 @@ pub async fn check_game_versions(path: &str, force: bool) -> MLE<()> { p.set_message("Update minecraft versions"); let creation_time = fs::metadata(path)?.created()?; - if !force && creation_time.elapsed().unwrap() < Duration::from_secs(60 * 60 * 24) { + if !force + && creation_time.elapsed().unwrap() < Duration::from_secs(60 * 60 * 24) + { return Ok(()); } @@ -107,7 +111,11 @@ impl VersionLevel { } } - pub async fn get(self, versions_path: &str, force_update: bool) -> MLE { + pub async fn get( + self, + versions_path: &str, + force_update: bool, + ) -> MLE { let path = format!("{}/versions.json", versions_path); check_game_versions(&path, force_update).await?; let mut versions = load_game_versions(&path)?.into_iter(); -- cgit v1.2.3