From 7aa1aeaffff72c7ddac808253595bff482c4f81d Mon Sep 17 00:00:00 2001 From: iff Date: Thu, 26 Sep 2024 02:26:40 +0200 Subject: [PATCH] refactor: consistence --- src/main.rs | 3 +-- src/suggestions.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4dfcf98..57ddf08 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,8 +61,7 @@ fn main() { return; } else { last_command = corrected_command; - let msg = execution.err().unwrap(); - error_msg = msg.to_lowercase(); + error_msg = execution.err().unwrap(); let retry_message = format!("{}...", t!("retry")); diff --git a/src/suggestions.rs b/src/suggestions.rs index 74e0fa2..6b7785d 100644 --- a/src/suggestions.rs +++ b/src/suggestions.rs @@ -277,8 +277,8 @@ pub fn confirm_suggestion(shell: &str, command: &str, highlighted: &str) -> Resu .output() .expect("failed to execute process"); let error_msg = match process.stderr.is_empty() { - true => String::from_utf8_lossy(&process.stdout), - false => String::from_utf8_lossy(&process.stderr), + true => String::from_utf8_lossy(&process.stdout).to_lowercase(), + false => String::from_utf8_lossy(&process.stderr).to_lowercase(), }; Err(error_msg.to_string()) }