refactor: consistence

This commit is contained in:
iff 2024-09-26 02:26:40 +02:00
parent 754214ede3
commit 7aa1aeafff
2 changed files with 3 additions and 4 deletions

View file

@ -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"));

View file

@ -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())
}