diff options
Diffstat (limited to 'src/utils/prompt_input.rs')
| -rw-r--r-- | src/utils/prompt_input.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/utils/prompt_input.rs b/src/utils/prompt_input.rs index f63823a..e887b9f 100644 --- a/src/utils/prompt_input.rs +++ b/src/utils/prompt_input.rs @@ -10,7 +10,8 @@ pub fn prompt_input_string(desc: &str, required: bool) -> anyhow::Result<String> } else { text = text.with_help_message(MSG_OPTIONAL) } - text.prompt().map_err(prompt_op_err) + let text = text.prompt()?; + Ok(text) } pub fn prompt_input_integer(desc: &str, required: bool) -> anyhow::Result<String> { @@ -36,11 +37,8 @@ pub fn prompt_input_integer(desc: &str, required: bool) -> anyhow::Result<String }) .with_help_message(MSG_OPTIONAL) } - text.prompt().map_err(prompt_op_err) -} - -pub fn prompt_op_err<T>(_: T) -> anyhow::Error { - anyhow::anyhow!("Not finish questionnaire, try again later!") + let text = text.prompt()?; + Ok(text) } #[derive(Debug, Clone, Copy)] |
