mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2026-02-02 15:45:11 +01:00
fix: clippy fixes caused the lose of color
This commit is contained in:
parent
334bd88b03
commit
af17b2b464
2 changed files with 4 additions and 4 deletions
|
|
@ -9,8 +9,6 @@ pub fn correct_command() -> Option<String> {
|
||||||
let shell = find_shell();
|
let shell = find_shell();
|
||||||
let last_command = find_last_command(&shell);
|
let last_command = find_last_command(&shell);
|
||||||
let command_output = command_output(&shell, &last_command);
|
let command_output = command_output(&shell, &last_command);
|
||||||
println!("Last command: {}", last_command);
|
|
||||||
println!("Command output: {}", command_output);
|
|
||||||
|
|
||||||
let split_command = last_command.split_whitespace().collect::<Vec<&str>>();
|
let split_command = last_command.split_whitespace().collect::<Vec<&str>>();
|
||||||
let command = match split_command.first().expect("No command found.") {
|
let command = match split_command.first().expect("No command found.") {
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@ pub fn highlight_difference(corrected_command: &str, last_command: &str) -> Stri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if changed {
|
if changed {
|
||||||
highlighted_command.push_str(&new.red().bold());
|
let colored = new.red().bold();
|
||||||
|
highlighted_command = format!("{}{}", highlighted_command, colored);
|
||||||
} else {
|
} else {
|
||||||
highlighted_command.push_str(&new.green());
|
let colored = new.green();
|
||||||
|
highlighted_command = format!("{}{}", highlighted_command, colored);
|
||||||
}
|
}
|
||||||
highlighted_command.push(' ');
|
highlighted_command.push(' ');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue