From 2f955ecef44287a79aebbb375ff81208db71d7ac Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 15 Aug 2024 19:31:34 +0200 Subject: [PATCH] chore: pub(crate) for cursor controller too --- src/cursor/controller.rs | 25 +++++-------------------- src/cursor/worker.rs | 12 ++++++------ 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/src/cursor/controller.rs b/src/cursor/controller.rs index 50237b3..51d1ab6 100644 --- a/src/cursor/controller.rs +++ b/src/cursor/controller.rs @@ -26,26 +26,11 @@ pub struct CursorController(pub(crate) Arc); #[derive(Debug)] pub(crate) struct CursorControllerInner { - op: mpsc::Sender, - last_op: Mutex>, - stream: Mutex>, - stop: mpsc::UnboundedSender<()>, -} - -impl CursorControllerInner { - pub(crate) fn new( - op: mpsc::Sender, - last_op: Mutex>, - stream: Mutex>, - stop: mpsc::UnboundedSender<()>, - ) -> Self { - Self { - op, - last_op, - stream, - stop, - } - } + pub(crate) op: mpsc::Sender, + pub(crate) last_op: Mutex>, + pub(crate) stream: Mutex>, + pub(crate) callback: watch::Sender>, + pub(crate) stop: mpsc::UnboundedSender<()>, } #[async_trait] diff --git a/src/cursor/worker.rs b/src/cursor/worker.rs index c35a9fc..89456a2 100644 --- a/src/cursor/worker.rs +++ b/src/cursor/worker.rs @@ -22,12 +22,12 @@ impl Default for CursorWorker { let (cur_tx, _cur_rx) = broadcast::channel(64); let (end_tx, end_rx) = mpsc::unbounded_channel(); let (change_tx, change_rx) = watch::channel(CursorEvent::default()); - let controller = CursorControllerInner::new( - op_tx, - Mutex::new(change_rx), - Mutex::new(cur_tx.subscribe()), - end_tx - ); + let controller = CursorControllerInner { + op: op_tx, + last_op: Mutex::new(change_rx), + stream: Mutex::new(cur_tx.subscribe()), + stop: end_tx, + }; Self { op: op_rx, changed: change_tx,