Get rid of the CloneIntoBoxedContextElement trait for now because I don't know if its still going to be necessary with this overhaul.

master
Tom Alexander 4 years ago
parent b8b4759d45
commit 15c8e3bf28
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -12,7 +12,7 @@ pub trait ContextElement:
+ Walkable
+ Renderable
+ Loopable
+ CloneIntoBoxedContextElement
// + CloneIntoBoxedContextElement
+ CompareContextElement
+ FromContextElement
{
@ -62,15 +62,15 @@ pub trait CompareContextElement: CastToAny {
fn partial_compare(&self, other: &dyn ContextElement) -> Option<Ordering>;
}
pub trait CloneIntoBoxedContextElement {
fn clone_to_box(&self) -> Box<dyn IntoContextElement>;
}
// pub trait CloneIntoBoxedContextElement {
// fn clone_to_box(&self) -> Box<dyn IntoContextElement>;
// }
impl<C: 'static + IntoContextElement + Clone> CloneIntoBoxedContextElement for C {
fn clone_to_box(&self) -> Box<dyn IntoContextElement> {
Box::new(self.clone())
}
}
// impl<C: 'static + IntoContextElement + Clone> CloneIntoBoxedContextElement for C {
// fn clone_to_box(&self) -> Box<dyn IntoContextElement> {
// Box::new(self.clone())
// }
// }
impl<C: 'static + ContextElement> CastToAny for C {
fn to_any(&self) -> &dyn Any {
@ -100,7 +100,7 @@ impl<C: ContextElement> FromContextElement for C {
}
}
pub trait IntoContextElement: Debug + Walkable + CloneIntoBoxedContextElement {
pub trait IntoContextElement: Debug + Walkable /* + CloneIntoBoxedContextElement*/ {
fn into_context_element(
&self,
renderer: &DustRenderer,

@ -10,7 +10,7 @@ mod renderer;
mod tree_walking;
mod walking;
pub use context_element::CloneIntoBoxedContextElement;
// pub use context_element::CloneIntoBoxedContextElement;
pub use context_element::CompareContextElement;
pub use context_element::ContextElement;
pub use context_element::IntoContextElement;

Loading…
Cancel
Save