mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-13 15:30:03 +00:00
Rename Confirmer
to UIThread
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
9349fbabdc
commit
88c3f15b3f
3 changed files with 16 additions and 16 deletions
|
@ -6,7 +6,7 @@ use tokio::task::spawn_blocking;
|
|||
use crate::BinstallError;
|
||||
|
||||
#[derive(Debug)]
|
||||
struct ConfirmerInner {
|
||||
struct UIThreadInner {
|
||||
/// Request for confirmation
|
||||
request_tx: mpsc::Sender<()>,
|
||||
|
||||
|
@ -14,7 +14,7 @@ struct ConfirmerInner {
|
|||
confirm_rx: mpsc::Receiver<Result<(), BinstallError>>,
|
||||
}
|
||||
|
||||
impl ConfirmerInner {
|
||||
impl UIThreadInner {
|
||||
fn new() -> Self {
|
||||
let (request_tx, mut request_rx) = mpsc::channel(1);
|
||||
let (confirm_tx, confirm_rx) = mpsc::channel(10);
|
||||
|
@ -75,13 +75,13 @@ impl ConfirmerInner {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Confirmer(Option<ConfirmerInner>);
|
||||
pub struct UIThread(Option<UIThreadInner>);
|
||||
|
||||
impl Confirmer {
|
||||
impl UIThread {
|
||||
/// * `enable` - `true` to enable confirmation, `false` to disable it.
|
||||
pub fn new(enable: bool) -> Self {
|
||||
Self(if enable {
|
||||
Some(ConfirmerInner::new())
|
||||
Some(UIThreadInner::new())
|
||||
} else {
|
||||
None
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue