mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
fix: some error handlings
This commit is contained in:
parent
1444eeab84
commit
15c1ba3370
7 changed files with 49 additions and 37 deletions
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue