mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
Treat failure to read input as UserAbort
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
5b0a97f380
commit
d79f30e897
1 changed files with 3 additions and 1 deletions
|
@ -52,7 +52,9 @@ impl UIThreadInner {
|
|||
stdout.flush().unwrap();
|
||||
|
||||
input.clear();
|
||||
stdin.read_line(&mut input).unwrap();
|
||||
if stdin.read_line(&mut input).is_err() {
|
||||
break Err(BinstallError::UserAbort);
|
||||
}
|
||||
|
||||
match input.as_str().trim() {
|
||||
"yes" | "y" | "YES" | "Y" => break Ok(()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue