From 7acc126de203f17a801558123b786413b146a210 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Thu, 20 May 2021 14:23:16 -0400 Subject: [PATCH] optimize file opening --- src/cache/fs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cache/fs.rs b/src/cache/fs.rs index 35109fa..19bba39 100644 --- a/src/cache/fs.rs +++ b/src/cache/fs.rs @@ -78,8 +78,7 @@ static WRITING_STATUS: Lazy>>> = pub(super) async fn read_file( path: &Path, ) -> Option, ImageMetadata), std::io::Error>> { - let std_file = std::fs::File::open(path).ok()?; - let mut file = File::from_std(std_file.try_clone().ok()?); + let mut file = File::open(path).await.ok()?; let mut reader = { // If the encryption key was set, use the encrypted disk reader instead;