fix: some error handlings

This commit is contained in:
iff 2023-08-07 20:21:02 +02:00
parent 1444eeab84
commit 15c1ba3370
7 changed files with 49 additions and 37 deletions

View file

@ -167,7 +167,7 @@ fn compare_string(a: &str, b: &str) -> usize {
}
pub fn confirm_suggestion(shell: &str, command: &str, highlighted: &str) -> Result<(), ()> {
println!{"{}\n", highlighted}
println! {"{}\n", highlighted}
println!("Press enter to execute the suggestion. Or press Ctrl+C to exit.");
std::io::stdin().read_line(&mut String::new()).unwrap();
@ -201,8 +201,8 @@ pub fn confirm_suggestion(shell: &str, command: &str, highlighted: &str) -> Resu
.expect("failed to wait on process");
if process.success() {
return Ok(());
Ok(())
} else {
return Err(());
Err(())
}
}