diff --git a/app-proto/src/assembly.rs b/app-proto/src/assembly.rs index 343cef8..7841922 100644 --- a/app-proto/src/assembly.rs +++ b/app-proto/src/assembly.rs @@ -97,17 +97,9 @@ pub trait Element: ProblemPoser + DisplayItem { fn set_column_index(&self, index: usize); } -// the `Element` trait needs to be dyn-compatible, so its method signatures can -// only use `Self` in the type of the receiver. that means `Element` can't -// implement `PartialEq`. if you need partial equivalence for `Element` trait -// objects, use this wrapper -#[derive(Clone)] -pub struct ElementRc(pub Rc); - -impl PartialEq for ElementRc { - fn eq(&self, ElementRc(other): &Self) -> bool { - let ElementRc(rc) = self; - Rc::ptr_eq(rc, &other) +impl PartialEq for dyn Element { + fn eq(&self, other: &Self) -> bool { + self.serial() == other.serial() } } diff --git a/app-proto/src/outline.rs b/app-proto/src/outline.rs index 97d6ac2..7e7048d 100644 --- a/app-proto/src/outline.rs +++ b/app-proto/src/outline.rs @@ -12,7 +12,6 @@ use crate::{ assembly::{ Element, ElementKey, - ElementRc, HalfCurvatureRegulator, InversiveDistanceRegulator, Regulator, @@ -254,7 +253,6 @@ pub fn Outline() -> View { .clone() .into_iter() .sorted_by_key(|(_, elt)| elt.id().clone()) - .map(|(key, elt)| (key, ElementRc(elt))) .collect() ); @@ -268,10 +266,10 @@ pub fn Outline() -> View { ) { Keyed( list=element_list, - view=|(key, ElementRc(elt))| view! { + view=|(key, elt)| view! { ElementOutlineItem(key=key, element=elt) }, - key=|(_, ElementRc(elt))| elt.serial() + key=|(_, elt)| elt.serial() ) } }