From 05a4c88967538fd2c7218cb52f81cd7e9b43abde Mon Sep 17 00:00:00 2001 From: alemi Date: Tue, 6 Aug 2024 23:00:45 +0200 Subject: [PATCH] fix: controller with 1 generic --- src/api/controller.rs | 5 +---- src/buffer/controller.rs | 2 -- src/cursor/controller.rs | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/api/controller.rs b/src/api/controller.rs index 18e5136..12ed35e 100644 --- a/src/api/controller.rs +++ b/src/api/controller.rs @@ -25,14 +25,11 @@ pub(crate) trait ControllerWorker { /// * if async is not feasible a [Controller::poll]/[Controller::try_recv] approach is possible #[async_trait::async_trait] pub trait Controller : Sized + Send + Sync { - /// type of upstream values, used in [Self::send] - type Input; - /// enqueue a new value to be sent to all other users /// /// success or failure of this function does not imply validity of sent operation, /// because it's integrated asynchronously on the background worker - fn send(&self, x: Self::Input) -> Result<()>; + fn send(&self, x: T) -> Result<()>; /// get next value from other users, blocking until one is available /// diff --git a/src/buffer/controller.rs b/src/buffer/controller.rs index 129f492..21dca71 100644 --- a/src/buffer/controller.rs +++ b/src/buffer/controller.rs @@ -77,8 +77,6 @@ impl Drop for StopOnDrop { #[async_trait] impl Controller for BufferController { - type Input = TextChange; - /// block until a text change is available /// this returns immediately if one is already available async fn poll(&self) -> crate::Result<()> { diff --git a/src/cursor/controller.rs b/src/cursor/controller.rs index 320871a..3f579d1 100644 --- a/src/cursor/controller.rs +++ b/src/cursor/controller.rs @@ -67,8 +67,6 @@ impl CursorController { #[async_trait] impl Controller for CursorController { - type Input = Cursor; - /// enqueue a cursor event to be broadcast to current workspace /// will automatically invert cursor start/end if they are inverted fn send(&self, mut cursor: Cursor) -> crate::Result<()> {