From 5d84800c0cbc584d6f55049d3e87267f03a19d50 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 22 Oct 2022 15:32:42 +0200 Subject: [PATCH] Manually implement Clone for AsyncExecutor --- src/context/gui.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/context/gui.rs b/src/context/gui.rs index 2b8f260c..ab7a4dc8 100644 --- a/src/context/gui.rs +++ b/src/context/gui.rs @@ -82,11 +82,19 @@ pub trait GuiContext: Send + Sync + 'static { // // NOTE: This is separate from `GuiContext` because adding a type parameter there would clutter up a // lot of structs, and may even be incompatible with the way certain GUI libraries work. -#[derive(Clone)] pub struct AsyncExecutor { pub(crate) inner: Arc, } +// Can't derive this since Rust then requires `P` to also be `Clone`able +impl Clone for AsyncExecutor

{ + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + } + } +} + /// A convenience helper for setting parameter values. Any changes made here will be broadcasted to /// the host and reflected in the plugin's [`Params`][crate::params::Params] object. These /// functions should only be called from the main thread.