From 37e08460377498165f421a522cb4eb1bb4e246b7 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Mon, 31 May 2021 17:19:46 +0200 Subject: Test cases for include and import --- src/loading/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/loading') diff --git a/src/loading/fs.rs b/src/loading/fs.rs index e2654a2e..a37d9630 100644 --- a/src/loading/fs.rs +++ b/src/loading/fs.rs @@ -194,9 +194,9 @@ fn load(cache: &mut FileCache, path: &Path) -> Option { /// Create a hash that is the same for all paths pointing to the same file. fn hash(path: &Path) -> Option { - Handle::from_path(path) - .map(|handle| FileHash(fxhash::hash64(&handle))) - .ok() + let file = File::open(path).ok()?; + let handle = Handle::from_file(file).ok()?; + Some(FileHash(fxhash::hash64(&handle))) } #[cfg(test)] -- cgit v1.2.3