mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 03:55:28 +00:00
refactor: rename "resolve_path" method
This commit is contained in:
parent
cede4b2624
commit
022e9f0883
@ -325,7 +325,7 @@ fn smart_unpack(
|
||||
|
||||
// Before moving, need to check if a file with the same name already exists
|
||||
// If it does, need to ask the user what to do
|
||||
new_path = match utils::resolve_path(&new_path, question_policy)? {
|
||||
new_path = match utils::resolve_path_conflict(&new_path, question_policy)? {
|
||||
Some(path) => path,
|
||||
None => return Ok(ControlFlow::Break(())),
|
||||
};
|
||||
|
@ -20,7 +20,7 @@ pub fn is_path_stdin(path: &Path) -> bool {
|
||||
}
|
||||
|
||||
/// Check if &Path exists, if it does then ask the user if they want to overwrite or rename it
|
||||
pub fn resolve_path(path: &Path, question_policy: QuestionPolicy) -> crate::Result<Option<PathBuf>> {
|
||||
pub fn resolve_path_conflict(path: &Path, question_policy: QuestionPolicy) -> crate::Result<Option<PathBuf>> {
|
||||
if path.exists() {
|
||||
match user_wants_to_overwrite(path, question_policy)? {
|
||||
FileConflitOperation::Cancel => Ok(None),
|
||||
|
Loading…
x
Reference in New Issue
Block a user