From 0dacb2d151e1790613b324b3051b8ce7aa26a90e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 14 Jun 2022 18:18:18 +0200 Subject: Fix error messages on Windows --- src/loading/fs.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/loading') diff --git a/src/loading/fs.rs b/src/loading/fs.rs index 23b67e34..c1576e86 100644 --- a/src/loading/fs.rs +++ b/src/loading/fs.rs @@ -121,10 +121,9 @@ impl Loader for FsLoader { } fn resolve(&self, path: &Path) -> io::Result { - let file = File::open(path)?; - let meta = file.metadata()?; + let meta = fs::metadata(path)?; if meta.is_file() { - let handle = Handle::from_file(file)?; + let handle = Handle::from_path(path)?; Ok(FileHash(fxhash::hash64(&handle))) } else { Err(io::ErrorKind::NotFound.into()) -- cgit v1.2.3