move Factory auto-impl
All checks were successful
buildbot/cargo fmt (1.72) Build done.
buildbot/cargo doc (1.72) Build done.
buildbot/cargo clippy (1.72) Build done.
buildbot/cargo clippy (1.65) Build done.
buildbot/cargo test (1.65) Build done.

This commit is contained in:
AF 2023-11-07 16:17:31 +00:00
parent 02550c0ded
commit 68527dac32
2 changed files with 7 additions and 7 deletions

View File

@ -111,6 +111,13 @@ pub trait Factory<'a, Ctx: Context<'a>>:
type _Mtbl: MentionableBase<'a, Fctr = Self> + MentionableTop<'a, Ctx>;
}
impl<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx> + ParseMode> Factory<'a, Ctx> for F
where
F::Mtbl: MentionableTop<'a, Ctx>,
{
type _Mtbl = Self::Mtbl;
}
/// [`Mentionable`] associated with the [`Factory`]. Mostly useful for `type` definitions.
pub type Mtbl<'a, F> = <F as FactoryBase<'a>>::Mtbl;

View File

@ -10,13 +10,6 @@ impl<'a, Ctx: Context<'a>, F: FactoryModeParse<'a, Ctx>> FactoryParse<'a, Ctx> f
}
}
impl<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx> + ParseMode> Factory<'a, Ctx> for F
where
F::Mtbl: MentionableTop<'a, Ctx>,
{
type _Mtbl = Self::Mtbl;
}
/// [`FactoryParse`] equivalent of [`ModeResult`].
pub type ModeResultM<'a, F, I> = ModeResultP<F, Mtbl<'a, F>, ParseError<'a, F>, I>;