type-neutral mdeserialize_sp
This commit is contained in:
parent
c7d69b9982
commit
4adb021a14
@ -176,7 +176,7 @@ where
|
|||||||
pub fn mdeserialize_sp<I: InCtx<'a, Ctx>>(
|
pub fn mdeserialize_sp<I: InCtx<'a, Ctx>>(
|
||||||
factory_data: &SP::FactoryData,
|
factory_data: &SP::FactoryData,
|
||||||
inctx: I,
|
inctx: I,
|
||||||
) -> ModeResultM<'a, Ctx, Self, I> {
|
) -> ModeResultP<Self, SP, <Self as FactoryBase<'a, Ctx>>::ParseError, I> {
|
||||||
let (fa, fb) = SP::factories(factory_data);
|
let (fa, fb) = SP::factories(factory_data);
|
||||||
let (a, inctx) = fa
|
let (a, inctx) = fa
|
||||||
.ideserialize(inctx)
|
.ideserialize(inctx)
|
||||||
@ -184,7 +184,7 @@ where
|
|||||||
Self::bind(
|
Self::bind(
|
||||||
fb.mdeserialize(inctx)
|
fb.mdeserialize(inctx)
|
||||||
.map_err(|e| SP::from_error_b(factory_data, e))?,
|
.map_err(|e| SP::from_error_b(factory_data, e))?,
|
||||||
|b| SP::from_parsed(factory_data, a, b).map(|pair| StaticPairObject { pair }),
|
|b| SP::from_parsed(factory_data, a, b),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,7 +195,10 @@ where
|
|||||||
SP::FB: FactoryModeParse<'a, Ctx>,
|
SP::FB: FactoryModeParse<'a, Ctx>,
|
||||||
{
|
{
|
||||||
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
fn mdeserialize<I: InCtx<'a, Ctx>>(&self, inctx: I) -> ModeResultM<'a, Ctx, Self, I> {
|
||||||
Self::mdeserialize_sp(&self.factory_data, inctx)
|
Ok(Self::map(
|
||||||
|
Self::mdeserialize_sp(&self.factory_data, inctx)?,
|
||||||
|
|pair| StaticPairObject { pair },
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mextend(
|
fn mextend(
|
||||||
|
Loading…
Reference in New Issue
Block a user