diff --git a/src/rstd/typeless.rs b/src/rstd/typeless.rs index 4774ad7..176be55 100644 --- a/src/rstd/typeless.rs +++ b/src/rstd/typeless.rs @@ -1,6 +1,6 @@ //! Previously part of [`crate::rcore`]. -use super::{cast::CastError, inlining::*, wrapped_origin::*, *}; +use super::{cast::CastError, wrapped_origin::*, *}; type TypelessSerialize<'a> = dyn 'a + Fn(&mut dyn Serializer); @@ -17,7 +17,7 @@ type TypelessParsed<'a, Ctx> = Result, Box>: 'a + Send + Sync { fn clone_box(&self) -> TdeBox<'a, Ctx>; - fn de<'c>(&self, indyn: Box>) -> TypelessParsed<'a, Ctx> + fn de<'c>(&self, demoted: Demoted<'a, 'c, Ctx>) -> TypelessParsed<'a, Ctx> where 'a: 'c; } @@ -93,9 +93,7 @@ impl<'a, Ctx: Context<'a>> Factory<'a, Ctx> for TypelessFactory<'a, Ctx> { type ParseError = TypelessError<'a>; fn deserialize(&self, inctx: impl InCtx<'a, Ctx>) -> ParseResult<'a, Ctx, Self> { - self.t_deserialize - .de(Box::new(inctx)) - .map_err(TypelessError) + self.t_deserialize.de(inctx.demote()).map_err(TypelessError) } fn extend(&self, mentionable: Self::Mtbl, tail: &[u8]) -> ParseResult<'a, Ctx, Self> { @@ -128,11 +126,11 @@ where Box::new(self.clone()) } - fn de<'c>(&self, indyn: Box>) -> TypelessParsed<'a, Ctx> + fn de<'c>(&self, demoted: Demoted<'a, 'c, Ctx>) -> TypelessParsed<'a, Ctx> where 'a: 'c, { - self.deserialize(indyn) + self.deserialize(demoted) .map_err(|e| Box::new(e) as Box) .map(Rc::new) .map(TypelessMentionable::from_typed)