diff --git a/src/sharry/file/mod.rs b/src/sharry/file/mod.rs index 434b987..e948103 100644 --- a/src/sharry/file/mod.rs +++ b/src/sharry/file/mod.rs @@ -2,10 +2,10 @@ mod chunks; use std::{ ffi::OsStr, - fs::metadata, + fs::{canonicalize, metadata}, hash::{Hash, Hasher}, io::{self, ErrorKind}, - path::{Path, PathBuf, absolute}, + path::{Path, PathBuf}, }; use log::{debug, error}; @@ -33,7 +33,7 @@ impl Hash for File { impl File { pub fn new(path: impl AsRef) -> io::Result { - let abs_path = absolute(path)?; + let abs_path = canonicalize(path)?; let m = metadata(&abs_path)?; if !m.is_file() {