mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 03:55:28 +00:00
fix: remove unused clear_path function
This commit is contained in:
parent
77d999d33a
commit
782cd27580
@ -19,20 +19,6 @@ pub fn is_path_stdin(path: &Path) -> bool {
|
|||||||
path.as_os_str() == "-"
|
path.as_os_str() == "-"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Remove `path` asking the user to overwrite if necessary.
|
|
||||||
///
|
|
||||||
/// * `Ok(true)` means the path is clear,
|
|
||||||
/// * `Ok(false)` means the user doesn't want to overwrite
|
|
||||||
/// * `Err(_)` is an error
|
|
||||||
pub fn clear_path(path: &Path, question_policy: QuestionPolicy) -> crate::Result<bool> {
|
|
||||||
if path.exists() && !user_wants_to_overwrite(path, question_policy)? {
|
|
||||||
return Ok(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
remove_file_or_dir(path)?;
|
|
||||||
|
|
||||||
Ok(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn resolve_path(path: &Path, question_policy: QuestionPolicy) -> crate::Result<Option<PathBuf>> {
|
pub fn resolve_path(path: &Path, question_policy: QuestionPolicy) -> crate::Result<Option<PathBuf>> {
|
||||||
if path.exists() {
|
if path.exists() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user