Additional clone removals for wasm
This commit is contained in:
parent
7f9e5765d2
commit
4758e2ff75
@ -15,7 +15,7 @@ pub struct Bus<Message> {
|
||||
|
||||
impl<Message> Bus<Message>
|
||||
where
|
||||
Message: 'static + Clone,
|
||||
Message: 'static,
|
||||
{
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
|
@ -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<Message> {
|
||||
title: String,
|
||||
ui: Rc<RefCell<Box<dyn Application<Message = Message>>>>,
|
||||
vdom: Rc<RefCell<Option<dodrio::VdomWeak>>>,
|
||||
}
|
||||
|
||||
impl<Message> Clone for Instance<Message> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
title: self.title.clone(),
|
||||
ui: Rc::clone(&self.ui),
|
||||
vdom: Rc::clone(&self.vdom),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<Message> Instance<Message>
|
||||
where
|
||||
Message: 'static + Clone,
|
||||
Message: 'static
|
||||
{
|
||||
fn new(ui: impl Application<Message = Message> + 'static) -> Self {
|
||||
Self {
|
||||
@ -221,7 +231,7 @@ where
|
||||
|
||||
impl<Message> dodrio::Render for Instance<Message>
|
||||
where
|
||||
Message: 'static + Clone,
|
||||
Message: 'static,
|
||||
{
|
||||
fn render<'a, 'bump>(
|
||||
&'a self,
|
||||
|
Loading…
Reference in New Issue
Block a user