diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-04-23 11:19:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-04-23 11:19:58 +0300 |
commit | 1f5d9aed39495980736f25bbd7ec01d5193494c0 (patch) | |
tree | d32f4af9ac94c7569246f20c1e91bc741e7c5fe4 | |
parent | 28c1652e0fa61563def69343141ac6c06854eaa6 (diff) | |
download | summain-rs-1f5d9aed39495980736f25bbd7ec01d5193494c0.tar.gz |
don't spawn blocking
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -64,7 +64,7 @@ impl ManifestEntry { let m = symlink_metadata(path)?; let hash = if m.is_file() { let path = path.to_path_buf(); - Some(tokio::task::spawn_blocking(move || file_checksum(path)).await??) + Some(file_checksum(path).await?) } else { None }; @@ -86,7 +86,7 @@ impl ManifestEntry { } } -fn file_checksum(path: PathBuf) -> std::io::Result<String> { +async fn file_checksum(path: PathBuf) -> std::io::Result<String> { let mut hasher = Sha256::new(); let file = File::open(path)?; |