mirror of
https://github.com/ouch-org/ouch.git
synced 2025-07-29 14:12:49 +00:00
make cargo fmt happy
This commit is contained in:
parent
fe05fe067c
commit
a643108012
@ -26,7 +26,7 @@ use crate::{
|
||||
self, concatenate_os_str_list, dir_is_empty, nice_directory_display, to_utf, try_infer_extension,
|
||||
user_wants_to_continue,
|
||||
},
|
||||
warning, Opts, QuestionPolicy, QuestionAction, Subcommand,
|
||||
warning, Opts, QuestionAction, QuestionPolicy, Subcommand,
|
||||
};
|
||||
|
||||
// Used in BufReader and BufWriter to perform less syscalls
|
||||
|
@ -23,7 +23,7 @@ pub mod opts;
|
||||
|
||||
pub use error::{Error, Result};
|
||||
pub use opts::{Opts, Subcommand};
|
||||
pub use utils::{QuestionPolicy, QuestionAction};
|
||||
pub use utils::{QuestionAction, QuestionPolicy};
|
||||
|
||||
/// The status code returned from `ouch` on error
|
||||
pub const EXIT_FAILURE: i32 = libc::EXIT_FAILURE;
|
||||
|
@ -11,8 +11,7 @@ mod question;
|
||||
pub use formatting::{concatenate_os_str_list, nice_directory_display, strip_cur_dir, to_utf, Bytes};
|
||||
pub use fs::{cd_into_same_dir_as, clear_path, create_dir_if_non_existent, dir_is_empty, try_infer_extension};
|
||||
pub use question::{
|
||||
create_or_ask_overwrite, user_wants_to_continue, user_wants_to_overwrite,
|
||||
QuestionPolicy, QuestionAction,
|
||||
create_or_ask_overwrite, user_wants_to_continue, user_wants_to_overwrite, QuestionAction, QuestionPolicy,
|
||||
};
|
||||
pub use utf8::{get_invalid_utf8_paths, is_invalid_utf8};
|
||||
|
||||
|
@ -37,7 +37,6 @@ pub enum QuestionAction {
|
||||
Decompression,
|
||||
}
|
||||
|
||||
|
||||
/// Check if QuestionPolicy flags were set, otherwise, ask user if they want to overwrite.
|
||||
pub fn user_wants_to_overwrite(path: &Path, question_policy: QuestionPolicy) -> crate::Result<bool> {
|
||||
match question_policy {
|
||||
@ -74,7 +73,11 @@ pub fn create_or_ask_overwrite(path: &Path, question_policy: QuestionPolicy) ->
|
||||
}
|
||||
|
||||
/// Check if QuestionPolicy flags were set, otherwise, ask the user if they want to continue.
|
||||
pub fn user_wants_to_continue(path: &Path, question_policy: QuestionPolicy, question_action: QuestionAction) -> crate::Result<bool> {
|
||||
pub fn user_wants_to_continue(
|
||||
path: &Path,
|
||||
question_policy: QuestionPolicy,
|
||||
question_action: QuestionAction,
|
||||
) -> crate::Result<bool> {
|
||||
match question_policy {
|
||||
QuestionPolicy::AlwaysYes => Ok(true),
|
||||
QuestionPolicy::AlwaysNo => Ok(false),
|
||||
|
Loading…
x
Reference in New Issue
Block a user