diff --git a/web/src/bus.rs b/web/src/bus.rs index 1b650b28..09908679 100644 --- a/web/src/bus.rs +++ b/web/src/bus.rs @@ -15,7 +15,7 @@ pub struct Bus { impl Bus where - Message: 'static + Clone, + Message: 'static, { pub(crate) fn new() -> Self { Self { diff --git a/web/src/lib.rs b/web/src/lib.rs index d4c422d2..7ea22e85 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -91,7 +91,7 @@ pub trait Application { /// The type of __messages__ your [`Application`] will produce. /// /// [`Application`]: trait.Application.html - type Message: Clone; + type Message; /// Initializes the [`Application`]. /// @@ -148,16 +148,26 @@ pub trait Application { } } -#[derive(Clone)] + struct Instance { title: String, ui: Rc>>>, vdom: Rc>>, } +impl Clone for Instance { + fn clone(&self) -> Self { + Self { + title: self.title.clone(), + ui: Rc::clone(&self.ui), + vdom: Rc::clone(&self.vdom), + } + } +} + impl Instance where - Message: 'static + Clone, + Message: 'static { fn new(ui: impl Application + 'static) -> Self { Self { @@ -221,7 +231,7 @@ where impl dodrio::Render for Instance where - Message: 'static + Clone, + Message: 'static, { fn render<'a, 'bump>( &'a self,