diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-07-09 15:15:36 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-07-09 15:15:36 +0300 |
commit | e01f733b4e3eb9e5448a211109f2f4ad37c9c796 (patch) | |
tree | ac43c5bbd6be7ca73ceb7b28b71b0bcd6206ce73 | |
parent | e78fc7011b045c8143f6ef02e37ba8cbf5787386 (diff) | |
download | summain-rs-e01f733b4e3eb9e5448a211109f2f4ad37c9c796.tar.gz |
feat: use tokio I/O to get metadata for files
Sponsored-by: author
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -32,10 +32,10 @@ use serde::Serialize; use sha2::{Digest, Sha256}; use std::fs::File; -use std::fs::{read_link, symlink_metadata}; use std::io::{BufReader, Read}; use std::os::linux::fs::MetadataExt; use std::path::{Path, PathBuf}; +use tokio::fs::{read_link, symlink_metadata}; const BUF_SIZE: usize = 1024 * 1024; @@ -69,9 +69,9 @@ impl ManifestEntry { /// /// The structure can be serialized using serde. pub async fn new(path: &Path) -> std::io::Result<Self> { - let m = symlink_metadata(path)?; + let m = symlink_metadata(path).await?; let target = if m.file_type().is_symlink() { - Some(read_link(path)?) + Some(read_link(path).await?) } else { None }; |