mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Fix locking of stdou
in UIThreadInner
which blocks the printing in main thread and prevents it from exiting. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
cea67b2e54
commit
ede134d851
1 changed files with 7 additions and 7 deletions
|
@ -32,14 +32,14 @@ impl UIThreadInner {
|
|||
break;
|
||||
}
|
||||
|
||||
// Lock stdout so that nobody can interfere
|
||||
// with confirmation.
|
||||
let mut stdout = io::stdout().lock();
|
||||
|
||||
let res = loop {
|
||||
writeln!(&mut stdout, "Do you wish to continue? yes/[no]").unwrap();
|
||||
write!(&mut stdout, "? ").unwrap();
|
||||
stdout.flush().unwrap();
|
||||
{
|
||||
let mut stdout = io::stdout().lock();
|
||||
|
||||
writeln!(&mut stdout, "Do you wish to continue? yes/[no]").unwrap();
|
||||
write!(&mut stdout, "? ").unwrap();
|
||||
stdout.flush().unwrap();
|
||||
}
|
||||
|
||||
input.clear();
|
||||
stdin.read_line(&mut input).unwrap();
|
||||
|
|
Loading…
Add table
Reference in a new issue