From 62c219254109e9480b4121a8363c2e52dcdbac03 Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 3 Sep 2023 21:29:10 +0000 Subject: [PATCH] `TopoVec` --- src/rcore.rs | 2 +- src/rcore/singular.rs | 6 ------ src/rcore/topology.rs | 8 ++++++++ src/rstd/singular.rs | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/rcore.rs b/src/rcore.rs index d257a36..e22451c 100644 --- a/src/rcore.rs +++ b/src/rcore.rs @@ -45,7 +45,7 @@ pub use self::resolution::{ }; pub use self::singular::{SingularError, SingularResolution}; pub use self::to_hex::hex; -pub use self::topology::MentionableTop; +pub use self::topology::{MentionableTop, TopoVec}; /// Helper alias for [`WeakFunctor::F`] of [`FunctorContext::T`]. /// diff --git a/src/rcore/singular.rs b/src/rcore/singular.rs index 22447a9..4c6af2c 100644 --- a/src/rcore/singular.rs +++ b/src/rcore/singular.rs @@ -54,9 +54,3 @@ impl Display for SingularError { } impl Error for SingularError {} - -impl<'a, Ctx: Context<'a>> PointsVisitor<'a, Ctx> for Vec>> { - fn visit>(&mut self, point: &Point<'a, Ctx, A>) { - self.push(Arc::new(point.clone()) as _); - } -} diff --git a/src/rcore/topology.rs b/src/rcore/topology.rs index 8f506f7..b431f43 100644 --- a/src/rcore/topology.rs +++ b/src/rcore/topology.rs @@ -19,3 +19,11 @@ pub trait MentionableTop<'a, Ctx: Context<'a>>: 'a { where Self: Mentionable<'a, Ctx>; } + +pub type TopoVec<'a, Ctx> = Vec>>; + +impl<'a, Ctx: Context<'a>> PointsVisitor<'a, Ctx> for TopoVec<'a, Ctx> { + fn visit>(&mut self, point: &Point<'a, Ctx, A>) { + self.push(Arc::new(point.clone()) as _); + } +} diff --git a/src/rstd/singular.rs b/src/rstd/singular.rs index aa90ef9..8985360 100644 --- a/src/rstd/singular.rs +++ b/src/rstd/singular.rs @@ -18,7 +18,7 @@ use super::*; /// # } /// ``` pub struct SingularResolver<'a, Ctx: Context<'a>> { - points: Vec>>, + points: TopoVec<'a, Ctx>, } impl<'a, Ctx: Context<'a>> SingularResolver<'a, Ctx> {