remove MentionableExt
from ctypeless
This commit is contained in:
parent
17f974fb0f
commit
084d99b82b
@ -112,7 +112,7 @@ impl<'a, Ctx: 'a + Context> TypelessMentionable<'a, Ctx> {
|
|||||||
pub fn from_typed<A: Mentionable<'a, Ctx>>(mentionable: Rc<A>) -> Self {
|
pub fn from_typed<A: Mentionable<'a, Ctx>>(mentionable: Rc<A>) -> Self {
|
||||||
let factory = TypelessFactory::from_typed(mentionable.factory());
|
let factory = TypelessFactory::from_typed(mentionable.factory());
|
||||||
let topology = mentionable.topology();
|
let topology = mentionable.topology();
|
||||||
let points = mentionable.points_vec();
|
let points = mentionable.points_vec_2();
|
||||||
TypelessMentionable {
|
TypelessMentionable {
|
||||||
t_serialize: Box::new(move |serializer| mentionable.serialize(serializer)),
|
t_serialize: Box::new(move |serializer| mentionable.serialize(serializer)),
|
||||||
t_factory: factory,
|
t_factory: factory,
|
||||||
@ -167,16 +167,3 @@ impl<'a> TypelessError<'a> {
|
|||||||
TypelessError(Box::new(error))
|
TypelessError(Box::new(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait MentionableExt<'a, Ctx: 'a + Context>: Mentionable<'a, Ctx> {
|
|
||||||
/// [Vec] of [Point]s as used by [`Mentionable::topology`].
|
|
||||||
fn points_vec(&self) -> Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> MentionableExt<'a, Ctx> for A {
|
|
||||||
fn points_vec(&self) -> Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>> {
|
|
||||||
let mut points = Vec::new();
|
|
||||||
self.points_typeless(&mut points);
|
|
||||||
points
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user