From c595be270c51e4308361a5811bfc503ee5086454 Mon Sep 17 00:00:00 2001 From: timofey Date: Sat, 29 Jul 2023 10:11:42 +0000 Subject: [PATCH] `ExternalPointsProxy` --- src/rstd/collections/stack.rs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/rstd/collections/stack.rs b/src/rstd/collections/stack.rs index 00e1c51..83c0d02 100644 --- a/src/rstd/collections/stack.rs +++ b/src/rstd/collections/stack.rs @@ -52,34 +52,30 @@ impl< { } -pub trait StackCompatibleProxy<'a, Ctx: Context<'a>>: FactoryProxy<'a, Ctx> +pub trait ExternalPointsProxy<'a, Ctx: Context<'a>, T>: FactoryProxy<'a, Ctx> where Self::F: Factory<'a, Ctx>, { - type T; - - fn points_typed_rest(stack: &Self::T, points: &mut impl PointsVisitor<'a, Ctx>); + fn exp_points_typed(stack: &T, points: &mut impl PointsVisitor<'a, Ctx>); } impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> ExternalPoints<'a, Ctx, Stack<'a, Ctx, Self>> for A where as WithParseMode>::WithMode: - StackCompatibleProxy<'a, Ctx, T = Stack<'a, Ctx, A>, F = Fctr<'a, Ctx, A>>, + ExternalPointsProxy<'a, Ctx, Stack<'a, Ctx, A>, F = Fctr<'a, Ctx, A>>, { fn ex_points_typed(stack: &Stack<'a, Ctx, Self>, points: &mut impl PointsVisitor<'a, Ctx>) { - < as WithParseMode>::WithMode as StackCompatibleProxy<'a, Ctx>>::points_typed_rest(stack, points) + < as WithParseMode>::WithMode as ExternalPointsProxy<'a, Ctx, _>>::exp_points_typed(stack, points) } } -impl<'a, Ctx: Context<'a>, F: RegularFactory<'a, Ctx>> StackCompatibleProxy<'a, Ctx> - for WithMode +impl<'a, Ctx: Context<'a>, F: RegularFactory<'a, Ctx>> + ExternalPointsProxy<'a, Ctx, Stack<'a, Ctx, Mtbl<'a, Ctx, F>>> for WithMode where F::Mtbl: MentionableTop<'a, Ctx>, { - type T = Stack<'a, Ctx, Mtbl<'a, Ctx, F>>; - - fn points_typed_rest( + fn exp_points_typed( stack: &Stack<'a, Ctx, Mtbl<'a, Ctx, Self::F>>, points: &mut impl PointsVisitor<'a, Ctx>, ) { @@ -87,14 +83,12 @@ where } } -impl<'a, Ctx: Context<'a>, F: InlineableFactory<'a, Ctx>> StackCompatibleProxy<'a, Ctx> - for WithMode +impl<'a, Ctx: Context<'a>, F: InlineableFactory<'a, Ctx>> + ExternalPointsProxy<'a, Ctx, Stack<'a, Ctx, Mtbl<'a, Ctx, F>>> for WithMode where F::Mtbl: MentionableTop<'a, Ctx>, { - type T = Stack<'a, Ctx, Mtbl<'a, Ctx, F>>; - - fn points_typed_rest( + fn exp_points_typed( stack: &Stack<'a, Ctx, Mtbl<'a, Ctx, Self::F>>, points: &mut impl PointsVisitor<'a, Ctx>, ) {