mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
removed clone bount on the type argument of SignalSetter
This commit is contained in:
parent
63e70db736
commit
67c5eda099
1 changed files with 16 additions and 2 deletions
|
@ -29,11 +29,17 @@ use crate::{RwSignal, Scope, WriteSignal};
|
|||
/// assert_eq!(count(), 8);
|
||||
/// # });
|
||||
/// ```
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct SignalSetter<T>(SignalSetterTypes<T>)
|
||||
where
|
||||
T: 'static;
|
||||
|
||||
impl<T> Clone for SignalSetter<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self(self.0.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> SignalSetter<T>
|
||||
where
|
||||
T: 'static,
|
||||
|
@ -103,7 +109,6 @@ impl<T> From<RwSignal<T>> for SignalSetter<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
enum SignalSetterTypes<T>
|
||||
where
|
||||
T: 'static,
|
||||
|
@ -112,6 +117,15 @@ where
|
|||
Mapped(Scope, Rc<dyn Fn(T)>),
|
||||
}
|
||||
|
||||
impl<T> Clone for SignalSetterTypes<T> {
|
||||
fn clone(&self) -> Self {
|
||||
match self {
|
||||
Self::Write(arg0) => Self::Write(*arg0),
|
||||
Self::Mapped(cx, f) => Self::Mapped(*cx, f.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> std::fmt::Debug for SignalSetterTypes<T>
|
||||
where
|
||||
T: std::fmt::Debug,
|
||||
|
|
Loading…
Reference in a new issue