summaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs10
1 files changed, 5 insertions, 5 deletions
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<Path>, expect_size: Option<usize>,
pub async fn ensure_file(path: impl AsRef<Path>, url: Option<&str>, expect_size: Option<usize>, expect_sha1: Option<Digest>, online: bool, force_download: bool) -> Result<bool, EnsureFileError> {
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 {