diff options
Diffstat (limited to 'src/loading')
| -rw-r--r-- | src/loading/fs.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Buffer> { /// Create a hash that is the same for all paths pointing to the same file. fn hash(path: &Path) -> Option<FileHash> { - 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)] |
