From 43ae010a9349a9e45282ecda7b1bea7a841031af Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 7 May 2023 16:56:42 +0000 Subject: [PATCH] move `MentionableExt` to `core::typeless` --- src/core.rs | 13 ------------- src/core/typeless.rs | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/core.rs b/src/core.rs index 8471a6f..6c6dbc8 100644 --- a/src/core.rs +++ b/src/core.rs @@ -76,19 +76,6 @@ pub trait Mentionable<'a, Ctx: 'a + Context>: 'a + Serializable { fn points(&self, points: &mut Vec>>); } -pub trait MentionableExt<'a, Ctx: 'a + Context>: Mentionable<'a, Ctx> { - /// [Vec] of [Point]s as used by [`Mentionable::topology`]. - fn points_vec(&self) -> Vec>>; -} - -impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> MentionableExt<'a, Ctx> for A { - fn points_vec(&self) -> Vec>> { - let mut points = Vec::new(); - self.points(&mut points); - points - } -} - /// Shorthand for the type of vaalues returned by [`Factory::deserialize`]. pub type ParseResult<'a, Ctx, F> = Result<>::Mtbl, >::ParseError>; diff --git a/src/core/typeless.rs b/src/core/typeless.rs index 38f11ec..1b94713 100644 --- a/src/core/typeless.rs +++ b/src/core/typeless.rs @@ -169,3 +169,16 @@ impl<'a> TypelessError<'a> { TypelessError(Box::new(error)) } } + +pub trait MentionableExt<'a, Ctx: 'a + Context>: Mentionable<'a, Ctx> { + /// [Vec] of [Point]s as used by [`Mentionable::topology`]. + fn points_vec(&self) -> Vec>>; +} + +impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> MentionableExt<'a, Ctx> for A { + fn points_vec(&self) -> Vec>> { + let mut points = Vec::new(); + self.points(&mut points); + points + } +}