From 6a1bb0980facadcc22cbae27f57782050e7924a1 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Sat, 1 Feb 2025 00:20:54 -0600 Subject: random changes --- src/util.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs index af960bd..7510a33 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,3 +1,5 @@ +mod progress; + use std::error::Error; use std::fmt::{Display, Formatter}; use std::io::ErrorKind; @@ -188,12 +190,10 @@ pub async fn should_download(path: impl AsRef, expect_size: Option, pub async fn ensure_file(path: impl AsRef, url: Option<&str>, expect_size: Option, expect_sha1: Option, online: bool, force_download: bool) -> Result { let path = path.as_ref(); - if !force_download { - if !should_download(path, expect_size, expect_sha1).await + if !force_download && !should_download(path, expect_size, expect_sha1).await .map_err(|e| EnsureFileError::IO { what: "verifying file on disk", error: e })? { - - return Ok(false); - } + + return Ok(false); } if !online { -- cgit v1.2.3-70-g09d2