summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-23 08:08:01 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-23 08:08:01 +0300
commitaa5d21c8865837025c81e7e7b3648049262eecee (patch)
tree4b58dee5c3d51c7b5d59684a4017eccf866664a9
parent486f5f69b6e2d10eafa44c28b93caa8454e48911 (diff)
downloadsummain-rs-aa5d21c8865837025c81e7e7b3648049262eecee.tar.gz
async file_checksum
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 00c64cf..9ce3b58 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -63,7 +63,7 @@ impl ManifestEntry {
pub async fn new(path: &Path) -> std::io::Result<Self> {
let m = symlink_metadata(path)?;
let hash = if m.is_file() {
- Some(file_checksum(path)?)
+ Some(file_checksum(path).await?)
} else {
None
};
@@ -85,7 +85,7 @@ impl ManifestEntry {
}
}
-fn file_checksum(path: &Path) -> std::io::Result<String> {
+async fn file_checksum(path: &Path) -> std::io::Result<String> {
let mut hasher = Sha256::new();
let file = File::open(path)?;