optimize file opening
This commit is contained in:
parent
ea8e031a3d
commit
7acc126de2
1 changed files with 1 additions and 2 deletions
3
src/cache/fs.rs
vendored
3
src/cache/fs.rs
vendored
|
@ -78,8 +78,7 @@ static WRITING_STATUS: Lazy<RwLock<HashMap<PathBuf, Receiver<WritingStatus>>>> =
|
||||||
pub(super) async fn read_file(
|
pub(super) async fn read_file(
|
||||||
path: &Path,
|
path: &Path,
|
||||||
) -> Option<Result<(InnerStream, Option<Header>, ImageMetadata), std::io::Error>> {
|
) -> Option<Result<(InnerStream, Option<Header>, ImageMetadata), std::io::Error>> {
|
||||||
let std_file = std::fs::File::open(path).ok()?;
|
let mut file = File::open(path).await.ok()?;
|
||||||
let mut file = File::from_std(std_file.try_clone().ok()?);
|
|
||||||
|
|
||||||
let mut reader = {
|
let mut reader = {
|
||||||
// If the encryption key was set, use the encrypted disk reader instead;
|
// If the encryption key was set, use the encrypted disk reader instead;
|
||||||
|
|
Loading…
Reference in a new issue