diff options
| author | sigoden <sigoden@gmail.com> | 2024-02-24 19:13:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-24 19:13:48 +0800 |
| commit | 21d1be5bedb13d08462e9800a1c3cbf93dd585bc (patch) | |
| tree | f21874bd7fefa25fccf443df1249cdf3c74e0763 /src/main.rs | |
| parent | 16b7ac071f3feed52939c2244ede2f0abe5230a2 (diff) | |
| download | aichat-21d1be5bedb13d08462e9800a1c3cbf93dd585bc.tar.gz | |
refactor: improve prompt error handling (#319)
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 8946985..29e034f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ mod utils; use crate::cli::Cli; use crate::config::{Config, GlobalConfig}; -use crate::utils::{prompt_op_err, run_command}; +use crate::utils::run_command; use anyhow::{bail, Result}; use clap::Parser; @@ -165,8 +165,7 @@ fn execute(config: &GlobalConfig, text: &str) -> Result<()> { )), } }) - .prompt() - .map_err(prompt_op_err)?; + .prompt()?; match anwser.as_str() { "E" | "e" => { |
