mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
Always create UIThreadInner
in UIThread
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ac492e6d8b
commit
417a10ca5d
1 changed files with 2 additions and 5 deletions
|
@ -96,11 +96,8 @@ pub struct UIThread(Option<UIThreadInner>);
|
|||
impl UIThread {
|
||||
/// * `enable` - `true` to enable confirmation, `false` to disable it.
|
||||
pub fn new(enable: bool) -> Self {
|
||||
Self(if enable {
|
||||
Some(UIThreadInner::new())
|
||||
} else {
|
||||
None
|
||||
})
|
||||
let ui_thread = UIThreadInner::new();
|
||||
Self(enable.then(|| ui_thread))
|
||||
}
|
||||
|
||||
pub async fn confirm(&mut self) -> Result<(), BinstallError> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue