feat: Manual impl of PartialEq for Coroutine (#2895)

This commit is contained in:
Marc Espin 2024-08-27 22:03:33 +02:00 committed by GitHub
parent a575a425e3
commit e6efd973d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,7 +110,6 @@ pub fn use_coroutine_handle<M: 'static>() -> Coroutine<M> {
use_hook(consume_context::<Coroutine<M>>) use_hook(consume_context::<Coroutine<M>>)
} }
#[derive(PartialEq)]
pub struct Coroutine<T: 'static> { pub struct Coroutine<T: 'static> {
needs_regen: Signal<bool>, needs_regen: Signal<bool>,
tx: CopyValue<Option<UnboundedSender<T>>>, tx: CopyValue<Option<UnboundedSender<T>>>,
@ -149,3 +148,9 @@ impl<T> Clone for Coroutine<T> {
*self *self
} }
} }
impl<T> PartialEq for Coroutine<T> {
fn clone(&self) -> Self {
self.needs_regen == other.needs_regen && self.tx == other.tx && self.task == other.task
}
}