Changing imports for Component::CurDir

This commit is contained in:
João M. Bezerra 2021-10-19 12:55:39 -03:00
parent e971b395c8
commit bf1eb22c01
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
use std::{
env, fs,
io::{self, prelude::*},
path::Component::CurDir,
path::Component,
path::{Path, PathBuf},
};
@ -48,7 +48,7 @@ where
fs::create_dir_all(&path)?;
}
}
let file_path = file_path.strip_prefix(CurDir).unwrap_or_else(|_| file_path.as_path());
let file_path = file_path.strip_prefix(Component::CurDir).unwrap_or_else(|_| file_path.as_path());
info!("{:?} extracted. ({})", file_path.display(), Bytes::new(file.size()));

View File

@ -2,7 +2,7 @@ use std::{
cmp, env,
ffi::OsStr,
fs::{self, ReadDir},
path::Component::CurDir,
path::Component,
path::{Path, PathBuf},
};
@ -46,7 +46,7 @@ pub fn user_wants_to_overwrite(path: &Path, flags: &oof::Flags) -> crate::Result
_ => {}
}
let path = path.strip_prefix(CurDir).unwrap_or_else(|_| path);
let path = path.strip_prefix(Component::CurDir).unwrap_or_else(|_| path);
Confirmation::new("Do you want to overwrite 'FILE'?", Some("FILE")).ask(Some(&to_utf(path)))
}