diff --git a/src/rstd/inlining.rs b/src/rstd/inlining.rs index dc05ff9..eb7f5cc 100644 --- a/src/rstd/inlining.rs +++ b/src/rstd/inlining.rs @@ -88,8 +88,10 @@ impl<'a: 'c, 'c, Ctx: Context<'a>> InCtx<'a, Ctx> for &'c mut dyn DeCtx<'a, Ctx> } } +pub type ResultDyn = Result<(A, I), Vec>; + pub trait InliningDyn<'c>: 'c { - fn idread_n(self, n: usize) -> Result<(Vec, Box>), Vec>; + fn idread_n(self, n: usize) -> ResultDyn, Box>>; fn idread_all(self) -> Vec; @@ -97,7 +99,7 @@ pub trait InliningDyn<'c>: 'c { } impl<'c, I: 'c + Inlining> InliningDyn<'c> for I { - fn idread_n(self, n: usize) -> Result<(Vec, Box>), Vec> { + fn idread_n(self, n: usize) -> ResultDyn, Box>> { let (vec, i) = self.iread_n(n, |slice| Vec::from(slice), |slice| Vec::from(slice))?; Ok((vec, Box::new(i))) } @@ -112,13 +114,13 @@ impl<'c, I: 'c + Inlining> InliningDyn<'c> for I { } pub trait InCtxDyn<'a: 'c, 'c, Ctx: Context<'a>>: InliningDyn<'c> { - fn icdnext_address(self) -> Result<(Address, Box>), Vec>; + fn icdnext_address(self) -> ResultDyn>>; fn idresolver(&self) -> Rc>; } impl<'a: 'c, 'c, Ctx: Context<'a>, I: 'c + InCtx<'a, Ctx>> InCtxDyn<'a, 'c, Ctx> for I { - fn icdnext_address(self) -> Result<(Address, Box>), Vec> { + fn icdnext_address(self) -> ResultDyn>> { let (address, i) = self.icnext_address(|slice| Vec::from(slice))?; Ok((address, Box::new(i))) }