mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-16 15:46:36 +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 {
|
impl UIThread {
|
||||||
/// * `enable` - `true` to enable confirmation, `false` to disable it.
|
/// * `enable` - `true` to enable confirmation, `false` to disable it.
|
||||||
pub fn new(enable: bool) -> Self {
|
pub fn new(enable: bool) -> Self {
|
||||||
Self(if enable {
|
let ui_thread = UIThreadInner::new();
|
||||||
Some(UIThreadInner::new())
|
Self(enable.then(|| ui_thread))
|
||||||
} else {
|
|
||||||
None
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn confirm(&mut self) -> Result<(), BinstallError> {
|
pub async fn confirm(&mut self) -> Result<(), BinstallError> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue