mod File: absolute -> canonicalize
This commit is contained in:
parent
256f3ce8ba
commit
fc38e51a03
1 changed files with 3 additions and 3 deletions
|
|
@ -2,10 +2,10 @@ mod chunks;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
ffi::OsStr,
|
ffi::OsStr,
|
||||||
fs::metadata,
|
fs::{canonicalize, metadata},
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
io::{self, ErrorKind},
|
io::{self, ErrorKind},
|
||||||
path::{Path, PathBuf, absolute},
|
path::{Path, PathBuf},
|
||||||
};
|
};
|
||||||
|
|
||||||
use log::{debug, error};
|
use log::{debug, error};
|
||||||
|
|
@ -33,7 +33,7 @@ impl Hash for File {
|
||||||
|
|
||||||
impl File {
|
impl File {
|
||||||
pub fn new(path: impl AsRef<Path>) -> io::Result<Self> {
|
pub fn new(path: impl AsRef<Path>) -> io::Result<Self> {
|
||||||
let abs_path = absolute(path)?;
|
let abs_path = canonicalize(path)?;
|
||||||
|
|
||||||
let m = metadata(&abs_path)?;
|
let m = metadata(&abs_path)?;
|
||||||
if !m.is_file() {
|
if !m.is_file() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue