From 4758e2ff75fc947f0c4a54d8efd87caf4db2afa2 Mon Sep 17 00:00:00 2001 From: Elliott Mahler Date: Sun, 12 Jan 2020 19:46:47 -0800 Subject: Additional clone removals for wasm --- web/src/lib.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'web/src/lib.rs') 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, -- cgit