loosen ResolverOrigin

This commit is contained in:
AF 2023-07-29 14:26:09 +00:00
parent 7995d536a7
commit 54e4d092b5
2 changed files with 9 additions and 5 deletions

View File

@ -9,8 +9,7 @@ pub trait Origin<'a, Ctx: Context<'a>>: 'a {
/// Try resolving the value.
fn resolve(self: Rc<Self>) -> Resolution<'a, Ctx, Self::Mtbl>
where
OFctr<'a, Ctx, Self>: Factory<'a, Ctx>,
Self::Mtbl: MentionableTop<'a, Ctx>;
OFctr<'a, Ctx, Self>: ParseFactory<'a, Ctx>;
/// Try resolving the bytes. Should avoid parsing the value.
fn resolve_bytes(self: Rc<Self>) -> HashResolution<'a, Ctx>;
}

View File

@ -1,6 +1,9 @@
use super::*;
impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> Point<'a, Ctx, A> {
impl<'a, Ctx: Context<'a>, A: MentionableBase<'a, Ctx>> Point<'a, Ctx, A>
where
A::Fctr: ParseFactory<'a, Ctx>,
{
/// Make a [Point] from an [Address].
pub fn from_address(
address: Address,
@ -40,7 +43,9 @@ fn _resolve_origin<'a, Ctx: Context<'a>, F: ParseFactory<'a, Ctx>>(
})
}
impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> Origin<'a, Ctx> for ResolverOrigin<'a, Ctx, F> {
impl<'a, Ctx: Context<'a>, F: ParseFactory<'a, Ctx>> Origin<'a, Ctx>
for ResolverOrigin<'a, Ctx, F>
{
type Mtbl = F::Mtbl;
fn factory(&self) -> OFctr<'a, Ctx, Self> {
@ -49,7 +54,7 @@ impl<'a, Ctx: Context<'a>, F: Factory<'a, Ctx>> Origin<'a, Ctx> for ResolverOrig
fn resolve(self: Rc<Self>) -> Resolution<'a, Ctx, Self::Mtbl>
where
OFctr<'a, Ctx, Self>: Factory<'a, Ctx>,
OFctr<'a, Ctx, Self>: ParseFactory<'a, Ctx>,
{
_resolve_origin(self)
}