remove 2
from MentionableExt
This commit is contained in:
parent
2145a9d852
commit
28065991f7
@ -87,7 +87,7 @@ where
|
|||||||
|resolved| match resolved {
|
|resolved| match resolved {
|
||||||
Ok(mentionable) => {
|
Ok(mentionable) => {
|
||||||
let resolver: Rc<dyn Resolver<'a, Ctx>> = Rc::new(CastResolver {
|
let resolver: Rc<dyn Resolver<'a, Ctx>> = Rc::new(CastResolver {
|
||||||
points: mentionable.points_vec_2(),
|
points: mentionable.points_vec(),
|
||||||
});
|
});
|
||||||
Ok((mentionable.bytes(), resolver))
|
Ok((mentionable.bytes(), resolver))
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ where
|
|||||||
factory.parse_slice(
|
factory.parse_slice(
|
||||||
&self.bytes(),
|
&self.bytes(),
|
||||||
map_resolver(Rc::new(CastResolver {
|
map_resolver(Rc::new(CastResolver {
|
||||||
points: self.points_vec_2(),
|
points: self.points_vec(),
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -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_2();
|
let points = mentionable.points_vec();
|
||||||
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,
|
||||||
|
@ -16,19 +16,19 @@ impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> Point<'a, Ctx, A> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait MentionableExt2<'a, Ctx: 'a + Context>: Mentionable<'a, Ctx> {
|
pub trait MentionableExt<'a, Ctx: 'a + Context>: Mentionable<'a, Ctx> {
|
||||||
/// References ([Point]s) to other objects. Typeless.
|
/// References ([Point]s) to other objects. Typeless.
|
||||||
fn points_typeless(&self, points: &mut Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>);
|
fn points_typeless(&self, points: &mut Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>);
|
||||||
/// [Vec] of [Point]s as used by [`Mentionable::topology`].
|
/// [Vec] of [Point]s as used by [`Mentionable::topology`].
|
||||||
fn points_vec_2(&self) -> Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>;
|
fn points_vec(&self) -> Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> MentionableExt2<'a, Ctx> for A {
|
impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> MentionableExt<'a, Ctx> for A {
|
||||||
fn points_typeless(&self, points: &mut Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>) {
|
fn points_typeless(&self, points: &mut Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>>) {
|
||||||
self.points_typed(points)
|
self.points_typed(points)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn points_vec_2(&self) -> Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>> {
|
fn points_vec(&self) -> Vec<Point<'a, Ctx, TypelessMentionable<'a, Ctx>>> {
|
||||||
let mut points = Vec::new();
|
let mut points = Vec::new();
|
||||||
self.points_typeless(&mut points);
|
self.points_typeless(&mut points);
|
||||||
points
|
points
|
||||||
|
Loading…
Reference in New Issue
Block a user